VerhulstVarK

The class VerhulstVarK is derived from Action and implements the Verhulst model of population dynamics with locally varying capacities..

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

Public Methods

constructor

VerhulstVarK(SPopulation<T> *pPop, SCellGrid *pCG, std::string sID, WELL512 **apWELL, double *adK, int iStride);
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).

adK

Array of K values (one value per cell).

iStride

The distance between two successive elements in the array (for normal array, use stride 1).

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

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), or \(\theta\) (ATTR_VERHULST_TURNOVER_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 VerhulstVarK object whose LinearBirth and LinearDeath are equal.