#include <SuppressionDurationMort.h>
Public Member Functions | |
clSuppressionDurationMort (clSimManager *p_oSimManager) | |
Constructor. | |
~clSuppressionDurationMort () | |
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 age beyond this can be calculated as a one-off. | |
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 "Tree Age" data member. | |
short int | m_iNumSpecies |
Number of species. | |
short int | m_iMaxMortTime |
Max number of pre-calculated mortalities. |
This causes mortality as a function of tree age. Age is tracked by the class clTreeAgeCalculator.
Probability of mortality is p = max/(1+(age/X0)^Xb). If tree age is 10000, mortality probability = 0 because that is an initial conditions tree.
Dead reason code is natural.
This class's namestring is "suppressiondurationmortshell". The parameter file call string is "Suppression Duration Mortality".
Copyright 2011 Charles D. Canham.
clSuppressionDurationMort::clSuppressionDurationMort | ( | clSimManager * | p_oSimManager | ) |
Constructor.
p_oSimManager | Sim Manager object. |
clSuppressionDurationMort::~clSuppressionDurationMort | ( | ) |
Destructor.
void clSuppressionDurationMort::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 clSuppressionDurationMort::DoMort | ( | clTree * | p_oTree, | |
const float & | fDbh, | |||
const short int & | iSpecies | |||
) | [virtual] |
Calculates mortality.
This retrieves the tree's age. The mortality probability for that year is compared to a random number to see if the tree lives or dies.
p_oTree | Tree being evaluated | |
fDbh | Tree's DBH | |
iSpecies | Species of the tree being evaluated |
Implements clMortalityBase.
float** clSuppressionDurationMort::mp_fMortProbs [protected] |
Precalculated mortality probabilities, out to m_iMaxMortTime; any age beyond this can be calculated as a one-off.
First index is species, second is age
float* clSuppressionDurationMort::mp_fMax [protected] |
Max mort rate - sized number of species.
float* clSuppressionDurationMort::mp_fX0 [protected] |
X0 - sized number of species.
float* clSuppressionDurationMort::mp_fXb [protected] |
Xb - sized number of species.
short int** clSuppressionDurationMort::mp_iDataCodes [protected] |
Codes for "Tree Age" data member.
Array size is number of species by number of types.
short int clSuppressionDurationMort::m_iNumSpecies [protected] |
Number of species.
For destructor.
short int clSuppressionDurationMort::m_iMaxMortTime [protected] |
Max number of pre-calculated mortalities.
This will be the biggest value of 2*X0.