SigDeath¶
This page describes the class SigDeath
The class SigDeath
is derived from Action
and serves as an age
cut-off (probability-based deaths such as in LinearDeath
make it possible
fot lucky agents to be hundreds of years old).
To calculate a death-probability for a given age we use a function
\(d_p\) based on the logistic (or sigmoid) function, which is defined as follows:
\(d_p(a) = 0 \;\;\; \forall a \in [-\infty, a_c - w]\),
\(d_p(a) = (1 + e^{-k \cdot w})/(1+e^{-k(a - a_{c})} \; \forall a \in [a_c - w, a_c + w]\),
\(d_p(a) = 1 \;\;\; \forall a \in [a_c + w, \infty]\),
where \(w\) is a positive real number, and \(k\) is the slope at the inflection point.

The translation brings the inflection point of the curve to the ccordinates \((a_c, 0.5)\), and the scaling is set to a value such that function \(d_p(a_c+w) = 1\).
This definition ensures that agents older than \(a_c+w\) will certainly die.
- Code:
Attributes
|
“SigDeath” |
action name |
|
“SigDeath_max_age” |
average maximum age (\(a_c\)) |
|
“SigDeath_range” |
half width of variable interval (\(w\)) |
|
“SigDeath_slope” |
slope at inflection point (\(r\)) |
Public Methods¶
constructor
¶
SigDeath(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).
Creates a NPPCalc
objects (in case temoerature and precipitation nee to be converted to NPP.
destructor
¶
virtual ~SigDeath();
The destructor does nothing,
preLoop
¶
virtual int preLoop();
Calculates the scale using the attribute values.
execute
¶
virtual int execute(int iAgentIndex, float fT);
iAgentIndex
Current agent’s index.
fT
Current simulation step.
Calculates the death probability for the agent, draws a random number \(r\), and kills the agent if \(r\) is less than the death probability.
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 file.
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 SigDeath
object whose attributes match those of this
.