state
— The model state¶
This module keeps track of the model state, that is the values of the state variables at a given time.
-
class
state.
State
(config)¶ Mandatory state variables:
-
pid
¶ Particle identifier
-
X, Y
Horizontal position [grid coordinates]
-
Z
¶ Vertical position [meters]
IBM state variables may vary and are defined in the configuration. For example, for salmon lice these are
age
- the “age” in degree-days, andsuper
- the number of individuals represented by a super-individual. These extra attributes can be accessed through their name asstate['age']
for instance.In addition the state keeps record of time:
-
timestep
¶ The time step counter
-
timestring
¶ The present time in ISO 8601 format: “yyyy-mm-dd hh:mm:ss”.
The State class has methods:
-
update
(grid, forcing)¶ Advance the model to the next step.
-
append
(new)¶ Append new particles to the state, new is a dictionary of new particles and their state.
-