Populations¶
Populations roughly correspond to species. All agents of a population class have some internal attributes, but they are also influenced by attributes of the population class. Examples for agent-specific attributes are age or gender; examples for population-specific attributes are average fertility age, or birth and death probabilities.
All populations are derived from the abstract base class PopBase, but most populations are derived from SPopulation.
Each population class defines an agent structure (essentialy variables for the internal attributes). In its constructor it creates objects for all the actions it requires and sets up communication channels (usually arrays) between then where needed.
Since SPopulation
and the actions do most of the work “behind the scenes”,
new population classes require only small amounts of new code:
mostly creation and deletion of action objects and arrays, adapting input and output for the agent strucure,
defining the start state of a new born agent, etc.
The tutorial gives a simple overview how various populations are built up.