StupidModel : version w

 

Habitat cells that grow food. Bug growth equal to the food consumed from the cell.
To download this tutorial =.

StupidModel - version 3
Modify the Cell class
 

3.1.1 Add an attribute(instance variable) named «food»

 

3.1.2 Create accessing method for the «food» (default value : Cormas random)

 

3.1.3 Notify to redisplay when attribute «food» is changed

 

3.1.4 Write a «growFood» method

Modify the Bug class
 

3.2.1 Add an attribute(instance variable) named «intakeRate»

 

3.2.2 Create accessing method for the «intakeRate» (default value : 0.5)

 

3.2.3 Write a «consumeFood» method

Adjust the scheduling of Stupid Model
Write a specific «povFood» method for the Cell class
Run version 3 of Stupid Model
 
 

 


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