#include <BrowsedStochasticMortality.h>
Inheritance diagram for clBrowsedStochasticMortality:
Public Member Functions | |
clBrowsedStochasticMortality (clSimManager *p_oSimManager) | |
Constructor. | |
~clBrowsedStochasticMortality () | |
Destructor. | |
void | DoShellSetup (xercesc::DOMDocument *p_oDoc) |
Reads in values from the parameter file. | |
bool | DoMort (clTree *p_oTree, const float &fDbh, const short int &iSpecies) |
Calculates mortality. | |
Protected Attributes | |
float * | mp_fBrowsedMortProb |
Probability of mortality when browsed - sized number of species. | |
float * | mp_fUnbrowsedMortProb |
Probability of mortality when unbrowsed - sized number of species. | |
short int ** | mp_iBrowsedCodes |
Codes for "Browsed" data member. | |
short int | m_iNumSpecies |
Number of species. |
This evaluates mortality at a constant rate, with a separate rate for browsed and unbrowsed trees. Trees are chosen at random to die.
Browsedness is determined by the Random Browse behavior (class clRandomBrowse). This class expects that behavior to be enabled and the "Browsed" bool data member to be present for all trees to which this behavior is applied.
This class's namestring is "browsed stochastic mortshell". The parameter file call string is "Browsed Stochastic Mortality".
Copyright 2007 Charles D. Canham.
clBrowsedStochasticMortality::clBrowsedStochasticMortality | ( | clSimManager * | p_oSimManager | ) |
Constructor.
p_oSimManager | Sim Manager object. |
void clBrowsedStochasticMortality::DoShellSetup | ( | xercesc::DOMDocument * | p_oDoc | ) | [virtual] |
Reads in values from the parameter file.
p_oDoc | DOM tree of parsed input file. |
modelErr | if the browsed behavior is missing, or if any mortality rate is not between 0 and 1. |
Reimplemented from clMortalityBase.
bool clBrowsedStochasticMortality::DoMort | ( | clTree * | p_oTree, | |
const float & | fDbh, | |||
const short int & | iSpecies | |||
) | [virtual] |
Calculates mortality.
This retrieves the tree's browsed status. If it is browsed, the browsed mortality probability is used. If it is unbrowsed, the unbrowsed probability is used. A random number is compared to the appropriate rate 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* clBrowsedStochasticMortality::mp_fBrowsedMortProb [protected] |
Probability of mortality when browsed - sized number of species.
This value comes from the parameter file as an annual probability, which is transformed in DoShellSetup() to a timestep probability.
float* clBrowsedStochasticMortality::mp_fUnbrowsedMortProb [protected] |
Probability of mortality when unbrowsed - sized number of species.
This value comes from the parameter file as an annual probability, which is transformed in DoShellSetup() to a timestep probability.
short int** clBrowsedStochasticMortality::mp_iBrowsedCodes [protected] |
Codes for "Browsed" data member.
Array size is number of species by number of types.
short int clBrowsedStochasticMortality::m_iNumSpecies [protected] |
Number of species.
For destructor.