Xholon - Stupid Model 3 - Habitat Cells and Resource
What is it
This is the third in a series of 16 "Stupid Models". It's intended as a starting point for learning how to develop grid and agent-based models using Xholon. It can also be used to compare Xholon with other agent-based modeling tools that have also implemented the Stupid Model series.
In this model, a habitat is introduced, that has food (initially 0.0) and specifies a maximum food production rate (0.01). Each time step, the amount of food at each habitat cell is increased by the food production rate, which is a random number between 0.0 and the maximum food production rate. The habitat produces its food each time step before the bug actions occur. A bug grows by exactly how much it eats. Its food consumption is the minimum of (1) the bugs' maximum consumption rate of 1.0, and (2) the amount of food currently available at the bug's habitat cell. Whatever the bug eats is subtracted from the food availability at its current habitat cell.
The HabitatCellStupidModel3.java class implements the habitat.
Look at StupidModel3_ClassDetails.xml in the config/StupidModels/StupidModel3 directory. The grid cell has changed name from GridCell to HabitatCell, and now implements the HabitatCellStupidModel3 class.