Test Spatial Entities : TSE

Test of Cormas aggregative spatial entities

Christophe Le Page, Pierre Bommel, Cirad

This model introduces the functionning principles of Cormas aggregative spatial entities. In the inheritage tree of the Cormas generic spatial entities, the compound spatial entity "SpatialEntity_Set" is specialized in :

  • "SpatialEntityAggregate", whose components should be contiguous
  • "SpatialEntityNotConnex", whose components may not be contiguous.

The operations of aggregation-disintegration are based on the two attributes "components" (a collection of lower level spatial entities) and "theCSE" (a register of belonging to higer level spatial entities).

The TSE model is a didactic model that allows to test two different ways to create spatial aggregates with Cormas.

In the first one (Spreading of 3 forests), the components (Aggregate) are defined as sets of contiguous cells sharing a same condition. Each cell has either #tree (aggregation condition) or #empty as value of its "context" attribute. The effective instanciations from the compound spatial entity "Aggregate" are submitted to an additional constraint about a minimum number (set to 15) of contiguous components verifying the aggregation condition. To let co-exist in the same model several spatial entities defined at different levels gives a great flexibility to write the dynamics of the model. Some of the processes are more easily described at the cellular level, as for some others, the aggregated level is more suitable. In this didactic and simplistic example, each cell has a fixed (very low) probability to switch its "context" attribute value (newContext). At the level of the aggregates, a spreading process (expand) from the edges is written like this: a given number (corresponding to the hundredth of the total number of components of the forestry entity) of cells at the outside edge are going to be aggregated to the forest. In order to keep a high compacity to the forestry entities, a priority is given to the cells that are surrounded by the highest number of already aggregated cells.
A second level aggregate (FragmentedEntity) is also designed in this model. It is the collection of first level aggregates whose size is upper 50. We obtain a hierarchical aggregation, from the basic level to the second level aggregate :

First level point of view
(Cell => povTree)
Second level point of view
(Aggregate => povId)
Third level point of view
(FragmentedEntity => povTree)

 

In the second one (Swelling from 10 seeds), 10 "seed" cells are randomly chosen in the 50*50 spatial grid. 10 aggregates are intialized with one of these seeds as a single component. The iterative building process of the aggregates relies on the integration, among the cells belonging to the outside edge of each aggregate, of all the one that do not yet belong to another aggregate. There is two ways to build these aggregates from seeds:

  • a progressive one (init= setSingletonAggregatesFromRandomSeeds and control=swellAggregates:)

    Progressive swell (swellAggregates)

  • and a quick one : the space partition is completed in one step :
    • [init=setAggregatesFromRandomSeeds] It constructs a complete space partition (6 aggregates) from 6 random seeds.

    • [init=setAggregatesFromRandomSeedsDistribution] It constructs 6 aggregates from 6 random seeds. The size of each aggregate should follow a size distribution (be equal to : 250 for the 2 firsts , 110 for the two seconds and 25 for the two lasts).


    • or [init=setAggregatesFromGivenSeeds] It constructs a complete space partition (5 aggregates) from 5 given seeds: 5 particular seeds on the space (central location, upper right and left location, lower right and left locations of the grid). The size of each aggregate should be equal to : 15 , 105, 210, 315 and 1200, but because of the lack of space, the size of the last aggregat is equal to 1036.
    • or [init=setAggregatesFifthFourth] It constructs a complete space partition by regular segmentation : 4 lines and 5 colomns

 

How to run this model

1. Spreading of 3 forests

1.1 From the Cormas main menu, load Files -> Load . Select TSE and choose SpreadForest.st version of TSE.
1.2 Click on the first icon of the Visualisation area to open the standard spatial grid.
1.3 From the spatial grid menu, use Tools -> Load an environment, select 3forests.env and validate. This will initialize a 50*50 grid and assign values (#tree or #empty) to the cell attribute context. (You can forget this step as the 'init' method does it automaticaly)
1.4 Right-click within the spatial grid window to select the povTree view for Cell.
1.5 Click on the Initialize button of the Simulation area.
1.6 Select the initForests and stepForests: methods, then validate by clicking on Apply and close. This version builds first level Aggregates (the forests are composed of connected cells with #forest as context) and second level aggregates : a fragmented aggregate composed with first level aggregates.
1.7 Right-click within the spatial grid window to select the povSize view for Aggregate.
1.8 Enter 30 in the Final time input field of the Simulation area.
1.9 Click on the Run button of the Simulation area.

2. Swelling from 10 seeds

2.1 From the Cormas main menu, load Files -> Load . Select TSE and choose SwellFromSeeds.st version of TSE. From the spatial grid menu, use Tools -> Load an environment, select 10seeds.env and validate. This will initialize a 50*50 grid and assign values (true or false) to the cell attribute seed
2.2 Right-click within the spatial grid window to select the povSeed view for Cell.
2.3 Click on the Initialize button of the Simulation area.
2.4 Select the init and step methods (init= setSingletonAggregatesFromRandomSeeds and control=swellAggregates for example), then validate by clicking on Apply and close.
2.5 Right-click within the spatial grid window to select the povId view for Aggregate.
2.6 Click on the Step button of the Simulation area.

3. Save and load your environment

3.1 From the Cormas main menu, load Files -> Load . Select TSE and choose Save-Load-Aggregates.st version of TSE.
3.2 The init method will load a 50*50 grid and load the aggregate instances and their neighbours.
3.2 If you want to see how to save the current grid, the aggregates and their neighbours, see the exportAggregatesAndNeighbours: method. (You can also save the neighbours of the cells. It can save time when you load big irregular grid (see the exportNeighboors method).

 


Le Cirad Centre de coopération internationale en recherche agronomique pour le développement
Informations légales © Copyright Cirad 2001-2015 cormas-webmaster@cirad.fr