#include <EpiphyticEstablishment.h>
Public Member Functions | |
clEpiphyticEstablishment (clSimManager *p_oSimManager) | |
Constructor. | |
~clEpiphyticEstablishment () | |
Destructor. | |
void | GetData (xercesc::DOMDocument *p_oDoc) |
Performs setup. | |
void | Action () |
Performs establishment. | |
void | RegisterTreeDataMembers () |
Overridden from clLightBase to do nothing. | |
float | CalcLightValue (clTree *p_oTree, clTreePopulation *p_oPop) |
Overridden from clLightBase to do nothing. | |
Protected Member Functions | |
void | GetParameterFileData (xercesc::DOMDocument *p_oDoc) |
Declares arrays and fills them with parameter file data. | |
void | DoLightSetup () |
Performs calculations required of light. | |
float | GetGLI (clTreePopulation *p_oPop, const float &fX, const float &fY, const float &fHeight) |
Gets the GLI for a given point. | |
void | GetTreeDataMemberCodes () |
Gets the return codes for the "dead" tree data member. | |
void | FormatQueryString () |
Formats the string in m_cQuery. | |
Protected Attributes | |
short int ** | mp_iDeadCodes |
Codes for the "dead" tree data member. | |
char * | m_cQuery |
String to pass to clTreePopulation::Find() in order to get the trees for which to calculate volume. | |
float * | mp_fA |
a in the seedling probability equation. | |
float * | mp_fB |
b in the seedling probability equation. | |
float * | mp_fC |
c in the seedling probability equation. | |
float * | mp_fM |
m in the seedling height equation. | |
float * | mp_fN |
n in the seedling height equation. | |
float | m_fMaxSearchDistance |
Maximum search distance for shading neighbors. | |
int | m_iSeedlingSpecies |
Species of seedlings to disperse. | |
short int | m_iNumTotalSpecies |
Number of species. |
Treefern establishment simulates epiphytic seedlings that root when their substrate tree dies. Unusually for behaviors, this is applied to the species that serve as substrate rather than the species to which the seedlings will belong. This is because all of the function parameters depend on the species of the substrate trees.
When trees of one of the substrate species dies, it may allow exactly one of its epiphytic seedlings to root. The probability that a dead tree will produce a seedling is:
P = 1 - (1/ ( 1 + exp( a + b * H + c * GLI )))
where H is the height of the substrate tree, and GLI is the light level at the tree's location. The light level is calculated halfway between the ground and the base of the crown.
If a seedling is produced, its height is:
HS = m + n*H
where HS is the height of the seedling in cm, and H is the height of the substrate tree in m.
The parameters designate which species the seedlings are of, and all seedlings produced are only of that species. The seedling roots in the exact spot where the substrate tree was.
Dead substrate trees are identified as such by checking the value in their "dead" code. Thus it is important that this behavior run after mortality but before tree removal.
Trees to which this behavior is applied ( that is, substrate trees) must also have a mortality behavior applied. This can only be applied to saplings and adults.
This behavior's name string and parameter file call string are both "Epiphytic Establishment".
Copyright 2009 Charles D. Canham.
clEpiphyticEstablishment::clEpiphyticEstablishment | ( | clSimManager * | p_oSimManager | ) |
Constructor.
p_oSimManager | Sim Manager object. |
clEpiphyticEstablishment::~clEpiphyticEstablishment | ( | ) |
Destructor.
void clEpiphyticEstablishment::GetData | ( | xercesc::DOMDocument * | p_oDoc | ) | [virtual] |
Performs setup.
Calls:
p_oDoc | DOM tree of parsed input file. |
Reimplemented from clLightBase.
void clEpiphyticEstablishment::Action | ( | ) | [virtual] |
Performs establishment.
This finds dead individuals of the establishment substrate species; calculates the GLI halfway up the trunk; and uses that to determine the probability that a seedling will root. If a seedling roots, its height is calculated. Then its xy coordinates and height are saved until all dead substrate trees have been processed. Then all seedlings are created at once. The reason seedlings are created at the end is because the height calculation may in fact make them saplings. Then they would affect GLI calculations.
Reimplemented from clLightBase.
void clEpiphyticEstablishment::RegisterTreeDataMembers | ( | ) | [inline, virtual] |
float clEpiphyticEstablishment::CalcLightValue | ( | clTree * | p_oTree, | |
clTreePopulation * | p_oPop | |||
) | [inline, virtual] |
void clEpiphyticEstablishment::GetParameterFileData | ( | xercesc::DOMDocument * | p_oDoc | ) | [protected] |
Declares arrays and fills them with parameter file data.
p_oDoc | Parsed parameter file. |
modelErr | if:
|
p_oDoc | DOM tree of parsed input file. |
void clEpiphyticEstablishment::DoLightSetup | ( | ) | [protected] |
Performs calculations required of light.
This calculates the brightness array for GLI and the values for m_fAziChunkConverter, m_fRcpTanMinAng, mp_fAziSlope, m_fSinMinSunAng, m_iMinAngRow, and m_fMaxSearchDistance.
float clEpiphyticEstablishment::GetGLI | ( | clTreePopulation * | p_oPop, | |
const float & | fX, | |||
const float & | fY, | |||
const float & | fHeight | |||
) | [protected] |
Gets the GLI for a given point.
p_oPop | Tree population, for getting shading neighbors. | |
fX | X coordinate of point for which to get GLI. | |
fY | Y coordinate of point for which to get GLI. | |
fHeight | Height at which to get GLI. |
void clEpiphyticEstablishment::GetTreeDataMemberCodes | ( | ) | [protected] |
Gets the return codes for the "dead" tree data member.
This declares and populates the mp_iDeadCodes array with the return codes for the "dead" tree int data member.
modelErr | if a tree to which this species is applied does not have a "dead" code, or if this is applied to anything but saplings or adults. |
void clEpiphyticEstablishment::FormatQueryString | ( | ) | [protected] |
Formats the string in m_cQuery.
This value will be used in Action() to pass to clTreePopulation::Find() in order to get the trees to act on.
short int** clEpiphyticEstablishment::mp_iDeadCodes [protected] |
Codes for the "dead" tree data member.
Array size is number of species by number of types. This is the only data member we will keep because it will serve as an easy flag for those trees to which this behavior is applied.
char* clEpiphyticEstablishment::m_cQuery [protected] |
String to pass to clTreePopulation::Find() in order to get the trees for which to calculate volume.
This will instigate a species/type search for all the species and types to which this behavior applies.
float* clEpiphyticEstablishment::mp_fA [protected] |
a in the seedling probability equation.
Array size is number of species.
float* clEpiphyticEstablishment::mp_fB [protected] |
b in the seedling probability equation.
Array size is number of species.
float* clEpiphyticEstablishment::mp_fC [protected] |
c in the seedling probability equation.
Array size is number of species.
float* clEpiphyticEstablishment::mp_fM [protected] |
m in the seedling height equation.
Array size is number of species.
float* clEpiphyticEstablishment::mp_fN [protected] |
n in the seedling height equation.
Array size is number of species.
float clEpiphyticEstablishment::m_fMaxSearchDistance [protected] |
Maximum search distance for shading neighbors.
int clEpiphyticEstablishment::m_iSeedlingSpecies [protected] |
Species of seedlings to disperse.
short int clEpiphyticEstablishment::m_iNumTotalSpecies [protected] |
Number of species.
For the destructor.