Messages from list : cormas@cirad.fr

Choose a topic among the following archives :

RE : accede collections

New Message Reply Date view Thread view Subject view Author view

Subject: RE : accede collections
From: Christophe Le Page (christophe.l@chula.ac.th)
Date: Tue Jul 29 2008 - 13:56:37 CEST

 

> First, I chose for the cell a 'cellular automata' class, but I am not

> sure this is the most convenient since it is standing for a land unit.

> Maybe a simple 'cell' class would be convenient?

 

[clp] Basically when any characteristic ('state') of a land unit depends on
some characteristics of its neighbouring land units, select
'SpatialEntityCell' as the super class of your land unit class and then use
what Cormas provides to ease the design of a cellular automata:

* at the spatial entity level: two inherited attributes named
'state' and 'bufferState' plus a generic method called 'updateState'. All
you have to do is to write a specific 'newState' method

* at the cormas model level: two predefined 'control' methods called
'stepSynchronously:' and 'stepAsynchronously:', respectively to update the
states of the cells in parallel or one after the other.

 

 

> In addition to that, I don't manage to acceed to 'theExploitations'

> collection (an Exploitation inherits from SpatialEntityNotConnex).

 

[clp] To access to the collection of Exploitation instances in any method of
your cormas model class, use 'self theExploitations'. But unless you have
written a specific instruction to create the instances of exploitations,
this collection remains empty! In your case, assuming that each cell has an
attribute named 'exploitationCode', this instruction may look like:

      self spaceModel

            setFragmentedEntities: Exploitation

            from: Cell

            attribute: #exploitationCode

You have to add this instruction in the 'init' method of your model.

 

To become familiar with the use of spatial entities made of lower level
spatial entities, have a look to http://cormas.cirad.fr/fr/applica/tse.htm
or to the attached pdf.

 

HTH,

Clp

 

 

New Message Reply Date view Thread view Subject view Author view
 

Back to home