Verhulst

The class Verhulst is derived from Action and implements the Verhulst model of populationd dynamics.

It incorporates a LinearBirth and a LinearDeath object.

../../images/LinBirthDeathCoords.png
Code:

Attributes

ATTR_VERHULST_NAME

“Verhulst”

action name

ATTR_VERHULST_B0_NAME

“Verhulst_b0”

birth probability for N=0

ATTR_VERHULST_D0_NAME

“Verhulst_d0”

death probability for N=0

ATTR_VERHULST_TURNOVER_NAME

“Verhulst_theta”

turnover

ATTR_VERHULST_CAPACITY_NAME

“Verhulst_K”

capacity (global)

Public Methods

constructor

Verhulst(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).

Initializes the member variables. The LinearBirth and LinearDeath objects can’t be created a this point, because the attributes are not yet known.

destructor

virtual ~Verhulst();

Deletes the LinearBirth and LinearDeath objects.

initialize

virtual int initialize(float fTime);
fT

Simulation time step.

Calls the intialize() method of the LinearBirth and LinearDeath objects (at this point we expect those objects have been created by a call to extractAttributesQDF()).

execute

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

Simulation time step.

Calls the execute() method of the LinearBirth and LinearDeath objects.

finalize

virtual int finalize(float fTime);
fT

Simulation time step.

Calls the finalize() method of the LinearBirth and LinearDeath objects.

extractAttributesQDF

virtual int extractAttributesQDF(hid_t hSpeciesGroup);
hSpeciesGroup

HDF handle for the species group to read from.

This method reads the attributes of this action from a QDF and creates a LinearBirth and a LinearDeath object withe appropriate attributes

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.

modifyAttributes

virtual int modifyAttributes(const std::string sAttrName, double dValue);
sAttrName

Name of attribute to change.

dValue

Value to set the attribute to.

This method can change the values of \(b_0\) (ATTR_VERHULST_B0_NAME), \(d_0\) (ATTR_VERHULST_D0_NAME), \(\theta\) (ATTR_VERHULST_TURNOVER_NAME), or the global capacity \(K\) (ATTR_VERHULST_CAPACITY_NAME).

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 Verhulst object whose LinearBirth and LinearDeath objects match.