Fertility¶
This page describes the class Fertility
The class Fertility
is derived from Action
, and determines the agents’ fertility.
- Code:
Attributes
|
“Fertility” |
action name |
|
“Fertility_min_age” |
minimum fertility age (puberty) |
|
“Fertility_max_age” |
maximum fertility age (climacterium) |
|
“Fertility_interbirth” |
interbirth interval |
Public Methods¶
constructor
¶
Fertility(SPopulation<T> *pPop, SCellGrid *pCG, std::string sID);
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.
destructor
¶
virtual ~Fertility();
The destructor does nothing.
execute
¶
int execute(int iAgentIndex, float fT);
iAgentIndex
Current agent’s index.
fT
Current simulation step
m_fFertilityMinAge
and m_fFertilityMaxAge
, and if the last birth was more than m_fInterbirth
years ago.m_fFertilityMinAge
.extractAttributesQDF
¶
virtual int extractAttributesQDF(hid_t hSpeciesGroup);
This method reads the fertility attributes 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 fertility attributes to the specified group in a QDF file.
tryGetAttributes
¶
virtual int tryGetAttributes(const ModuleComplex *pMC);
Extracts the fertility attributes from the ModuleComplex
object.
getMinAge
¶
float getMinAge();
Returns the minimum fertility age.
getMaxAge
¶
float getMaxAge() {return m_fFertilityMaxAge;};
Returns the maximum fertility age.
getInterBirth
¶
float getInterBirth() { return m_fInterbirth;};
Returns the interbirth interval.
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 Fertility
object whose attributes match thze ones of this
.