#include <StochasticBiLevelMortality.h>
Public Member Functions | |
clStochasticBiLevelMortality (clSimManager *p_oSimManager) | |
Constructor. | |
~clStochasticBiLevelMortality () | |
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. | |
void | SetNameData (char *cNameString) |
Captures the behavior name passed from the parameter file to set flags based on expected behavior. | |
Protected Types | |
typedef float(clStochasticBiLevelMortality::* | Ptr2LightLevel )(clTree *, const short int &) |
Define a type for pointers to functions to get light level. | |
Protected Member Functions | |
float | GetStormLightLevel (clTree *p_oTree, const short int &iSpecies) |
Gets the light level from the Storm Light grid for a tree. | |
float | GetGLILightLevel (clTree *p_oTree, const short int &iSpecies) |
Gets the GLI light level for a tree. | |
Protected Attributes | |
Ptr2LightLevel | getLightLevel |
Function pointer for using the appropriate light level getting function. | |
clGridBase * | mp_oStormLight |
"Storm Light" grid object | |
clTreePopulation * | mp_oPop |
Tree population - for getting data codes. | |
float * | mp_fLoLightMortProb |
Probability of mortality at low light - sized number of behavior species. | |
float * | mp_fHiLightMortProb |
Probability of mortality at low light - sized number of behavior species. | |
float * | mp_fHiLightThreshold |
Threshold between low light and high light mortality, as a value between 0 and 100 - sized number of behavior species. | |
int * | mp_iIndexes |
To help access the other arrays. | |
int ** | mp_iGLILightCodes |
Data member return codes for "Light" data member, if being used. | |
int | m_iLightCode |
Code for the "Light" data member of the "Storm Light" grid, if used. | |
bool | m_bIsGLI |
Whether this is the GLI version (true) or the Storm Light version (false). |
This evaluates mortality at a constant rate, with a separate rate at high and low light for each species. Trees are chosen at random to die.
Light levels come from either the "Storm Light" grid object produced by clStormLight or a GLI value stored in the "Light" data member of a tree.
This class's namestring is "stochastic bilevel mortshell". The parameter file call string is "Stochastic Bi-Level Mortality" or "Stochastic Bi-Level Mortality - GLI".
Copyright 2005 Charles D. Canham.
typedef float(clStochasticBiLevelMortality::* clStochasticBiLevelMortality::Ptr2LightLevel)(clTree *, const short int &) [protected] |
Define a type for pointers to functions to get light level.
clStochasticBiLevelMortality::clStochasticBiLevelMortality | ( | clSimManager * | p_oSimManager | ) |
Constructor.
p_oSimManager | Sim Manager object. |
clStochasticBiLevelMortality::~clStochasticBiLevelMortality | ( | ) |
Destructor.
void clStochasticBiLevelMortality::DoShellSetup | ( | xercesc::DOMDocument * | p_oDoc | ) | [virtual] |
Reads in values from the parameter file.
p_oDoc | DOM tree of parsed input file. |
modelErr | if the "Storm Light" grid is missing, or if any mortality rate is not between 0 and 1. |
Reimplemented from clMortalityBase.
deadCode clStochasticBiLevelMortality::DoMort | ( | clTree * | p_oTree, | |
const float & | fDbh, | |||
const short int & | iSpecies | |||
) | [virtual] |
Calculates mortality.
This retrieves the light level in the tree's grid cell. If it is above the threshold, the high-light mortality probability is used. If it is below the threshold, the low-light 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.
void clStochasticBiLevelMortality::SetNameData | ( | char * | cNameString | ) | [virtual] |
Captures the behavior name passed from the parameter file to set flags based on expected behavior.
cNameString | Behavior name from parameter file. |
Reimplemented from clBehaviorBase.
float clStochasticBiLevelMortality::GetStormLightLevel | ( | clTree * | p_oTree, | |
const short int & | iSpecies | |||
) | [protected] |
Gets the light level from the Storm Light grid for a tree.
p_oTree | Tree to get light level for. | |
iSpecies | Tree's species. |
float clStochasticBiLevelMortality::GetGLILightLevel | ( | clTree * | p_oTree, | |
const short int & | iSpecies | |||
) | [protected] |
Gets the GLI light level for a tree.
p_oTree | Tree to get light level for. | |
iSpecies | Tree's species. |
Function pointer for using the appropriate light level getting function.
clGridBase* clStochasticBiLevelMortality::mp_oStormLight [protected] |
"Storm Light" grid object
clTreePopulation* clStochasticBiLevelMortality::mp_oPop [protected] |
Tree population - for getting data codes.
float* clStochasticBiLevelMortality::mp_fLoLightMortProb [protected] |
Probability of mortality at low light - sized number of behavior species.
This value comes from the parameter file as an annual probability, which is transformed in DoShellSetup() to a timestep probability.
float* clStochasticBiLevelMortality::mp_fHiLightMortProb [protected] |
Probability of mortality at low light - sized number of behavior species.
This value comes from the parameter file as an annual probability, which is transformed in DoShellSetup() to a timestep probability.
float* clStochasticBiLevelMortality::mp_fHiLightThreshold [protected] |
Threshold between low light and high light mortality, as a value between 0 and 100 - sized number of behavior species.
int* clStochasticBiLevelMortality::mp_iIndexes [protected] |
To help access the other arrays.
int** clStochasticBiLevelMortality::mp_iGLILightCodes [protected] |
Data member return codes for "Light" data member, if being used.
First index is species, second is type.
int clStochasticBiLevelMortality::m_iLightCode [protected] |
Code for the "Light" data member of the "Storm Light" grid, if used.
bool clStochasticBiLevelMortality::m_bIsGLI [protected] |
Whether this is the GLI version (true) or the Storm Light version (false).