#include <ResourceMortality.h>
Inheritance diagram for clResourceMortality:
Public Member Functions | |
clResourceMortality (clSimManager *p_oSimManager) | |
Constructor. | |
~clResourceMortality () | |
Destructor. | |
void | DoShellSetup (xercesc::DOMDocument *p_oDoc) |
Performs setup for this behavior. | |
bool | DoMort (clTree *p_oTree, const float &fDbh, const short int &iSpecies) |
Calculates mortality according to the growth-resource mortality equation. | |
Protected Member Functions | |
void | ReadParameterFileData (xercesc::DOMDocument *p_oDoc) |
Reads in parameter file data. | |
void | GetResourceGrid () |
Gets the "Resource" grid. | |
void | GetTreeDataMemberCodes () |
Queries for the return codes of the "Growth", "X", and "Y" float data members of a tree. | |
Protected Attributes | |
clGridBase * | mp_oResourceGrid |
Grid containing the levels of the second resource. | |
short int ** | mp_iGrowthCodes |
Data member codes for "Growth" member - # behavior species by total # types. | |
short int ** | mp_iXCodes |
Data member codes for "X" tree data member - # behavior species by total # types. | |
short int ** | mp_iYCodes |
Data member codes for "Y" tree data member - # behavior species by total # types. | |
float * | mp_fRho |
Scaling factor - ρ in equation above. | |
float * | mp_fMu |
Function mode - μ in equation above. | |
float * | mp_fDelta |
Increase in survival due to growth - δ in equation above. | |
float * | mp_fSigma |
Shape of function in low-growth conditions - σ in equation above. | |
short int * | mp_iIndexes |
For array access. | |
float | m_fNumberYearsPerTimestep |
Number of years per timestep. | |
short int | m_iResourceCode |
Index for "Resource" data member of the "Resource" grid. |
This evaluates mortality probability as a function of growth and a second (unidentified) resource.
The probability of mortality is:
It saves some calculations to work with the probability of SURVIVAL instead of MORTALITY; remove the "1 - " part from the beginning of the above equation. To compound the survival probability over the number of years per timestep, use PX, where P is the annual probability of survival and X is the number of years per timestep.
Once a tree's survival probability has been calculated, a random number is used to determine if the tree lives or dies.
The value of the second resource comes from a grid called "Resource", with a single float member named "Resource". This behavior doesn't create this grid, and it's considered a fatal error if it is not present at setup. This behavior will not modify the contents of this grid in any way.
This class's namestring is "resourcemortshell". Its parameter file call string is "Growth resource mortality".
Copyright 2005 Charles D. Canham.
clResourceMortality::clResourceMortality | ( | clSimManager * | p_oSimManager | ) |
Constructor.
Sets the namestring.
void clResourceMortality::DoShellSetup | ( | xercesc::DOMDocument * | p_oDoc | ) | [virtual] |
Performs setup for this behavior.
Calls:
p_oDoc | Parsed DOM tree of parameter file. |
Reimplemented from clMortalityBase.
bool clResourceMortality::DoMort | ( | clTree * | p_oTree, | |
const float & | fDbh, | |||
const short int & | iSpecies | |||
) | [virtual] |
Calculates mortality according to the growth-resource mortality equation.
The equation is listed above.
fDbh | DBH of tree being evaluated - for seedlings will be 0 | |
p_oTree | Tree being evaluated | |
iSpecies | Species of the tree being evaluated |
Implements clMortalityBase.
void clResourceMortality::ReadParameterFileData | ( | xercesc::DOMDocument * | p_oDoc | ) | [protected] |
Reads in parameter file data.
p_oDoc | Parsed DOM tree of parameter file. |
void clResourceMortality::GetResourceGrid | ( | ) | [protected] |
Gets the "Resource" grid.
modelErr | if the grid named "Resource" is not present, or is not set up correctly. |
void clResourceMortality::GetTreeDataMemberCodes | ( | ) | [protected] |
Queries for the return codes of the "Growth", "X", and "Y" float data members of a tree.
The "Growth" data member should have been registered by a child class of clGrowthBase.
modelErr | if there is no code for any species/type combo which uses this behavior. |
clGridBase* clResourceMortality::mp_oResourceGrid [protected] |
Grid containing the levels of the second resource.
This is not created by this behavior; it is expected to already be available. It should be named "Resource" and have one float data member called "Resource".
float* clResourceMortality::mp_fRho [protected] |
Scaling factor - ρ in equation above.
Array size is number of behavior species.
float* clResourceMortality::mp_fMu [protected] |
Function mode - μ in equation above.
Array size is number of behavior species.
float* clResourceMortality::mp_fDelta [protected] |
Increase in survival due to growth - δ in equation above.
Array size is number of behavior species.
float* clResourceMortality::mp_fSigma [protected] |
Shape of function in low-growth conditions - σ in equation above.
Array size is number of behavior species.