OldAgeDeath

The class OldAgeDeath is derived from Action and serves as an age cut-off (probability-based deaths such as in LinearDeath make it possible that lucky agents can be hundreds of years old).

At each step and for each agent a random number \(r \in [-u, +u]\) is drawn, and the current maximuma age for the agent is set to \(m_{agent} = m + r\). If the agent’s age exceeds \(m_{agent}\), it is killed.

../../images/OldAgeDie.png

The age of agent 1 exceeds his current maximuma age and will be killed. Agent 2 will survive.

Code:

Attributes

ATTR_OLDAGEDEATH_NAME

“OldAgeDeath”

action name

ATTR_OLDAGEDEATH_MAXAGE_NAME

“OAD_max_age”

average maximum age

ATTR_OLDAGEDEATH_UNCERTAINTY_NAME

“OAD_uncertainty”

uncertainty

Public Methods

constructor

OldAgeDeath(SPopulation<T> *pPop, SCellGrid *pCG, std::string sID, WELL512 **apWELL);
pPop

A pointer to the SPopulation object performing this action.

pCG

A pointer to the SCellGrid object on which the simulation runs.

sID

An ID for this action.

apWELL

A pointer to an array of WELL512 random number generators (one for each thread).

destructor

virtual ~OldAgeDeath();

The destructor does nothing.

execute

virtual int execute(int iAgentIndex, float fT);
iAgentIndex

Current agent’s index.

fT

Current simulation step

This method is called for all agents (in parallel).
For each agent an age limit is calculated. If the agent’s age exceeds it, it is killed.

extractAttributesQDF

virtual int extractAttributesQDF(hid_t hSpeciesGroup);
hSpeciesGroup

HDF handle for the species group to read from.

This method reads the atttributes of this action from a QDF.

writeAttributesQDF

virtual int writeAttributesQDF(hid_t hSpeciesGroup);
hSpeciesGroup

HDF handle for the species group to write to.

This method writes the attributes of this action to the specified group in a QDF file.

tryGetAttributes

virtual int tryGetAttributes(const ModuleComplex *pMC);
pMC

A ModuleComplex object.

Extracts the action’s attributes from the ModuleComplex object.

isEqual

virtual bool isEqual(Action<T> *pAction, bool bStrict);
pAction

Pointer to an action object to compare with this.

bStrict

Strictness of comparisons (ignored here).

pAction is equal to this, if it is an OldAgeDeath object whose attributes match those of this.