AnimalReproducer

The class AnimalReproducer is derived from Action and manages mass-dependent parthenogenetic reproduction of agents. This class has been tailored for the use with SheepPop (see:ref:QHG Tutorial 08 - Simple Predator-Prey<TutorialGrassRabbit_ref>`).

If an agent exceeds a minimum “fertility mass”, a new agent with a specific mass is created, and this mass is subtracted from the parent’s mass.

Code:

Attributes

ATTR_ANIMALREP_NAME

“AnimalReproducer”

action name

ATTR_ANIMALREP_MASS_FERT_NAME

“MassFert”

minimum fertility mass

ATTR_ANIMALREP_MASS_BABY_NAME

“MassBaby”

new baby mass

ATTR_ANIMALREP_BIRTH_PROB_NAME

“BirthProb”

birth probability

Public Methods

constructor

AnimalReproducer(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 ~AnimalReproducer();

The destructor does nothing.

execute

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

Index of the current agent.

fT

Current simulation step.

If an agfent exceeds te minimum fertlity masas, a new agent is created with a certain proballity. cted from the parent’s mass.

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 a AnimalReproducer object whose attributes match those of this.