@@ -53,7 +53,7 @@ Besides benefits for performance and maintainability, ECS offers great flexibili
## Model purpose
The purpose of this model is to demonstrate the use of Entity-Component-Systems for individual-based models.
The purpose of this model is to demonstrate the use of the ECS approach for individual-based models.
## Entities, state variables and scales
...
...
@@ -135,7 +135,7 @@ public class IsSearching extends com.artemis.Component {}
**Resources**
> Resources are "things" that exist only once in the model, contrary to entities, and are potentially available for all submodels. Any instance of a Java class can become a resource. However, only one instance of each class is possible.
> Resources are objects that exist only once in the model, contrary to entities, and are potentially available for all submodels. When using the Artemis-odb, any instance of a Java class can become a resource. However, only one instance of each class is possible.
Grassers live in a two-dimensional world. The world is represented by a grid of grass that grassers can consume.
@@ -263,7 +261,13 @@ Submodels are described in their order of execution.
### Grass growth
Grass growth is logistic, with a capacity of 1.0.
Grass growth is logistic. The amount of grass is updated according
```math
p_{t+1} = p_t + r p_t \frac{k - p_t}{k}
```
where $`p_t`$ is the amount in the current step and $`p_{t+1}`$ in the next step. $`r`$ is the growth rate per step and $`k`$ is the capacity. Capacity is always 1.0.
> Since the grassing system does not use any entities, we simply extend `BaseSystem`. However, it requires access to the `Grass` grid, which is "injected" by the ECS through the line `@Wire Grass grass;`.
>
...
...
@@ -321,7 +325,7 @@ import grassing.comp.Energy;
@All(Energy.class)
publicclassMetabolismextendsIteratingSystem{
ComponentMapper<Energy>mEnergy;
ComponentMapper<Energy>energy;
privatefinalfloatconsumption;
...
...
@@ -331,7 +335,7 @@ public class Metabolism extends IteratingSystem {