#include <LightDepSeedSurvival.h>
Inheritance diagram for clLightDepSeedSurvival:
Public Member Functions | |
clLightDepSeedSurvival (clSimManager *p_oSimManager) | |
Constructor. | |
~clLightDepSeedSurvival () | |
Destructor. | |
void | GetData (xercesc::DOMDocument *p_oDoc) |
Performs setup. | |
void | Action () |
Performs establishment. | |
void | SetNameData (char *cNameString) |
Captures the namestring passed to this behavior. | |
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 | SetupGrid () |
Populates required grid pointers. | |
void | DoLightSetup () |
Performs calculations required of light. | |
float | GetGLI (clTreePopulation *p_oPop, const float &fX, const float &fY) |
Gets the GLI for a given point. | |
void | GetTreeDataMemberCodes () |
Gets the return codes for needed tree data members. | |
float | GetLightFavorability (const int &iSpecies, const float &fGLI) |
Calculates the light favorability for a given species and GLI. | |
float | GetLightExtinctionCoefficient (clTree *p_oTree) |
Gets the light extinction coefficent. | |
Protected Attributes | |
clGridBase * | mp_oSeedGrid |
Pointer to the "Dispersed Seeds" grid created by disperse behaviors. | |
clGridBase * | mp_oStormLightGrid |
Pointer to the "Storm Light" grid created by clStormLight, if needed. | |
float ** | mp_fLightExtCoeff |
Storm light extinction coefficients, if m_bUseStormLight is false. | |
float * | mp_fOptimumGLI |
Optimum light level at which there is no reduction in establishment - one per behavior species. | |
float * | mp_fLowGLISlope |
Slope of favorability dropoff below the optimum light level - one per behavior species. | |
float * | mp_fHighGLISlope |
Slope of favorability dropoff above the optimum light level - one per behavior species. | |
float | m_fLightHeight |
Height at which light is to be calculated, if m_bUseStormLight is false. | |
float | m_fMaxSearchDistance |
Maximum search distance for shading neighbors, if m_bUseStormLight is false. | |
short int * | mp_iSeedGridCode |
Data member codes for seed grid for number of seeds. | |
short int ** | mp_iDamageCodes |
Holds return data codes for the "stm_dmg" tree data member, if m_bUseStormLight is false. | |
short int * | mp_iIndexes |
Speeds access to arrays. | |
short int | m_iNumTotalSpecies |
Number of species. | |
short int | m_iLightCode |
Index for the "Light" data member of the Storm Light grid, if m_bUseStormLight is true. | |
bool | m_bUseStormLight |
Whether or not to have this behavior calculate GLI (false) or get GLI from the Storm Light grid (true). |
This behavior assesses seed survival based on light levels. The starting number of seeds is created by any disperse behavior and placed in the grid "Dispersed Seeds". The number of seeds surviving out of this number is a function of GLI. Because of the need to calculate light levels, this class descends from clGLIBase.
The number of seeds of a given species that survive in a particular "Dispersed Seeds" grid cell is:
The number of seeds is given a random round.
LE is calculated from GLI as:
GLI can come in two ways. The first method is that this behavior will calculate GLI like all other GLIs. There is one difference: neighbor trees that have hurricane damage have different light extinction coefficients from their undamaged neighbors. To achieve this, we override the function clLightBase::GetLightExtinctionCoefficient(). This effect is not required.
The second way is to get the GLI from the Storm Light grid.
A fatal error will be thrown if a disperse behavior is not used, or if Storm Light is the source of GLIs but it is not used.
The namestring and parameter file call string for this class is "Light Dependent Seed Survival" (for having this behavior calculate GLI) or "Storm Light Dependent Seed Survival" (for having Storm Light be the GLI source). Apply this behavior to the desired species; use any type, since type will be ignored.
Copyright 2005 Charles D. Canham.
clLightDepSeedSurvival::clLightDepSeedSurvival | ( | clSimManager * | p_oSimManager | ) |
Constructor.
p_oSimManager | Sim Manager object. |
void clLightDepSeedSurvival::GetData | ( | xercesc::DOMDocument * | p_oDoc | ) | [virtual] |
Performs setup.
Calls:
p_oDoc | DOM tree of parsed input file. |
Reimplemented from clLightBase.
void clLightDepSeedSurvival::Action | ( | ) | [virtual] |
Performs establishment.
For each grid cell in "Dispersed Seeds", for each species, this takes the number of seeds and determines how many of them germinate. Steps for each grid cell:
Reimplemented from clLightBase.
void clLightDepSeedSurvival::SetNameData | ( | char * | cNameString | ) | [virtual] |
Captures the namestring passed to this behavior.
This is overridden from clBehaviorBase so we can capture the namestring passed. Since this class can create multiple kinds of behaviors that function differently, this will capture what kind of behavior this is supposed to be.
cNameString | Behavior's namestring. |
Reimplemented from clBehaviorBase.
void clLightDepSeedSurvival::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 clLightDepSeedSurvival::SetupGrid | ( | ) | [protected] |
Populates required grid pointers.
This gets a pointer to the "Dispersed Seeds" grid and all its data members, and does the same for the "Storm Light" grid if m_bUseStormLight is true.
modelErr | if the "Dispersed Seeds" grid does not exist, or if the "Storm Light" grid does not exist and m_bUseStormLight is true. |
void clLightDepSeedSurvival::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. This function does nothing if m_bUseStormLight is false.
float clLightDepSeedSurvival::GetGLI | ( | clTreePopulation * | p_oPop, | |
const float & | fX, | |||
const float & | fY | |||
) | [protected] |
Gets the GLI for a given point.
If m_bUseStormLight is true, this gets the value of "Storm Light" for that grid. If false, this calculates GLI at the height in m_fLightHeight.
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. |
void clLightDepSeedSurvival::GetTreeDataMemberCodes | ( | ) | [protected] |
Gets the return codes for needed tree data members.
This declares and populates the mp_iDamageCodes array with the return codes for the "stm_dmg" tree int data member. It is not an error if they are not present. This function does nothing if m_bUseStormLight is false.
float clLightDepSeedSurvival::GetLightFavorability | ( | const int & | iSpecies, | |
const float & | fGLI | |||
) | [protected] |
Calculates the light favorability for a given species and GLI.
This GLI is turned into a proportion germinating according to the following:
iSpecies | Species for which to calculate light favorability. | |
fGLI | GLI value. |
float clLightDepSeedSurvival::GetLightExtinctionCoefficient | ( | clTree * | p_oTree | ) | [protected, virtual] |
Gets the light extinction coefficent.
If the tree has storm damage, the light extinction coefficient appropriate to the tree's damage category is returned. Otherwise the default light extinction coefficient behavior of clLightOrg is used.
p_oTree | Tree for which to obtain the light extinction coefficient. |
Reimplemented from clLightBase.
clGridBase* clLightDepSeedSurvival::mp_oSeedGrid [protected] |
Pointer to the "Dispersed Seeds" grid created by disperse behaviors.
clGridBase* clLightDepSeedSurvival::mp_oStormLightGrid [protected] |
Pointer to the "Storm Light" grid created by clStormLight, if needed.
float** clLightDepSeedSurvival::mp_fLightExtCoeff [protected] |
Storm light extinction coefficients, if m_bUseStormLight is false.
Array size is m_iNumTotalSpecies by 2 - number of damage categories.
float clLightDepSeedSurvival::m_fLightHeight [protected] |
Height at which light is to be calculated, if m_bUseStormLight is false.
float clLightDepSeedSurvival::m_fMaxSearchDistance [protected] |
Maximum search distance for shading neighbors, if m_bUseStormLight is false.
short int* clLightDepSeedSurvival::mp_iSeedGridCode [protected] |
Data member codes for seed grid for number of seeds.
Array size is # behavior species.
short int** clLightDepSeedSurvival::mp_iDamageCodes [protected] |
Holds return data codes for the "stm_dmg" tree data member, if m_bUseStormLight is false.
Array size is number of total species by 2 (saplings and adults).
short int clLightDepSeedSurvival::m_iNumTotalSpecies [protected] |
Number of species.
For the destructor.