#include <InsectInfestationMortality.h>
Public Member Functions | |
clInsectInfestationMortality (clSimManager *p_oSimManager) | |
Constructor. | |
~clInsectInfestationMortality () | |
Destructor. | |
void | DoShellSetup (xercesc::DOMDocument *p_oDoc) |
Reads in values from the parameter file. | |
deadCode | DoMort (clTree *p_oTree, const float &fDbh, const short int &iSpecies) |
Calculates mortality. | |
Protected Attributes | |
float ** | mp_fMortProbs |
Precalculated mortality probabilities, out to m_iMaxMortTime; any infestation time beyond this can be calculated as a one-off. | |
float * | mp_fIntercept |
Intercept - sized number of species. | |
float * | mp_fMax |
Max mort rate - sized number of species. | |
float * | mp_fX0 |
X0 - sized number of species. | |
float * | mp_fXb |
Xb - sized number of species. | |
short int ** | mp_iDataCodes |
Codes for "YearsInfested" data member. | |
short int | m_iNumSpecies |
Number of species. | |
short int | m_iMaxMortTime |
Max number of pre-calculated mortalities. |
This evaluates mortality for trees that have an insect infestation.
The probability of death is a function of the number of years infested, as follows:
P = I +((MAX - I)/(1+(T/X0)^Xb))
where P is mortality probability, I is the intercept (mortality at time of infestation), MAX is max mortality probability, T is infestation time in years, X0 is time at which mortality prob = 0.5, and Xb controls steepness of the mortality increase.
A random number determines whether the trees die. Those that die have "insect" passed as the reason code.
Insect infestation is determined by the behavior of class clInsectInfestation. This class expects that behavior to be enabled and the "YearsInfested" int data member to be present for all trees to which this behavior is applied.
This class's namestring is "insect infestation mortshell". The parameter file call string is "Insect Infestation Mortality".
Copyright 2010 Charles D. Canham.
clInsectInfestationMortality::clInsectInfestationMortality | ( | clSimManager * | p_oSimManager | ) |
Constructor.
p_oSimManager | Sim Manager object. |
clInsectInfestationMortality::~clInsectInfestationMortality | ( | ) |
Destructor.
void clInsectInfestationMortality::DoShellSetup | ( | xercesc::DOMDocument * | p_oDoc | ) | [virtual] |
Reads in values from the parameter file.
p_oDoc | DOM tree of parsed input file. |
modelErr | if:
|
Reimplemented from clMortalityBase.
deadCode clInsectInfestationMortality::DoMort | ( | clTree * | p_oTree, | |
const float & | fDbh, | |||
const short int & | iSpecies | |||
) | [virtual] |
Calculates mortality.
This retrieves the tree's time of infestation. If it is infested, the mortality probability for that year is compared to a random number to see if the tree lives or dies. If it is uninfested, it does not die.
p_oTree | Tree being evaluated | |
fDbh | Tree's DBH | |
iSpecies | Species of the tree being evaluated |
Implements clMortalityBase.
float** clInsectInfestationMortality::mp_fMortProbs [protected] |
Precalculated mortality probabilities, out to m_iMaxMortTime; any infestation time beyond this can be calculated as a one-off.
First index is species, second is time of infestation
float* clInsectInfestationMortality::mp_fIntercept [protected] |
Intercept - sized number of species.
float* clInsectInfestationMortality::mp_fMax [protected] |
Max mort rate - sized number of species.
float* clInsectInfestationMortality::mp_fX0 [protected] |
X0 - sized number of species.
float* clInsectInfestationMortality::mp_fXb [protected] |
Xb - sized number of species.
short int** clInsectInfestationMortality::mp_iDataCodes [protected] |
Codes for "YearsInfested" data member.
Array size is number of species by number of types.
short int clInsectInfestationMortality::m_iNumSpecies [protected] |
Number of species.
For destructor.
short int clInsectInfestationMortality::m_iMaxMortTime [protected] |
Max number of pre-calculated mortalities.
This will be the biggest value of 2*X0.