#include <BasalAreaLight.h>
Inheritance diagram for clBasalAreaLight:
Public Member Functions | |
clBasalAreaLight (clSimManager *p_oSimManager) | |
Constructor. | |
~clBasalAreaLight () | |
Destructor. | |
void | DoShellSetup (xercesc::DOMDocument *p_oDoc) |
Does setup for this behavior. | |
void | TimestepCleanup () |
Sets the grid updated flag back to false. | |
float | CalcLightValue (clTree *p_oTree, clTreePopulation *p_oPop) |
Gets the light value for a particular tree. | |
float | GetMeanGLI (const float &fConiferBA, const float &fAngiospermBA) |
Calculates the mean GLI for a given pair of basal areas. | |
Protected Types | |
enum | iTreeType { angiosperm, conifer } |
Species type status. More... | |
Protected Member Functions | |
void | UpdateGridValues (clTreePopulation *p_oPop) |
Performs the grid updating each timestep. | |
Protected Attributes | |
clGridBase * | mp_oLightGrid |
Grid object which holds the light values. | |
enum clBasalAreaLight::iTreeType * | mp_iSpeciesTypes |
Species type status What type each species is. | |
float * | mp_fStatus |
The status of each species, as angiosperm or conifer. | |
float | m_fA |
The "a" parameter for the mean light function. | |
float | m_fConiferB |
The conifer "b" parameter for the mean light function. | |
float | m_fAngiospermB |
The angiosperm "b" parameter for the mean light function. | |
float | m_fConiferC |
The conifer "c" parameter for the mean light function. | |
float | m_fAngiospermC |
The angiosperm "c" parameter for the mean light function. | |
float | m_fSigma |
The sigma parameter of the lognormal PDF function. | |
float | m_fMinDbh |
The minimum DBH for trees to count towards density in a cell. | |
float | m_fRadius |
The search radius for trees. | |
float | m_fChangeThreshold |
The amount by which total basal area in a cell has to change in order to trigger a new light calculation. | |
short int | m_iGridLightCode |
Return code for the "Light" data member of the "Basal Area Light" grid. | |
short int | m_iGridConBACode |
Return code for the "Con BA" data member of the "Basal Area Light" grid. | |
short int | m_iGridAngBACode |
Return code for the "Ang BA" data member of the "Basal Area Light" grid. | |
bool | m_bGridUpdated |
Whether or not the "Basal Area Light" grid has been updated this timestep. |
This behavior calculates light level as a function of local tree basal area. Basal area is split between conifers and angiosperms. The two basal area totals are used to calculate a mean light level, which is used to choose a random value from a lognormal probability distribution. In order to ensure some level of continuity through time, a grid cell's light level is not recalculated unless the local tree basal area has changed by more than a threshold set by the user.
A grid, "Basal Area Light", is used to store light values. Trees get the light levels of their grid cell.
The mean light level for a grid cell is calculated as follows:
For purposes of basal area calculation, each species is assigned to "conifer" or "angiosperm" status. Seedlings and snags are never counted in basal area. Other trees only count if they have a DBH above a user-set minimum.
After the mean light level is calculated, it is turned into a "location parameter" (mu) for the lognormal PDF as follows:
The mu value is used as the zeta value in a lognormal random draw.
Note that this behavior is dependent on the size of grid cells for its behavior.
This behavior creates a new grid called "Basal Area Light". There's more on that grid below.
The namestring for this behavior is "basalarealightshell"; the parameter file call string is "Basal Area Light".
Copyright 2006 Charles D. Canham.
enum clBasalAreaLight::iTreeType [protected] |
clBasalAreaLight::clBasalAreaLight | ( | clSimManager * | p_oSimManager | ) |
Constructor.
Sets the namestring.
p_oSimManager | Sim Manager object. |
clBasalAreaLight::~clBasalAreaLight | ( | ) |
Destructor.
Frees memory.
void clBasalAreaLight::DoShellSetup | ( | xercesc::DOMDocument * | p_oDoc | ) | [virtual] |
Does setup for this behavior.
This reads parameter file values and sets up the grid.
p_oDoc | DOM tree of parsed input file. |
modelErr | if:
|
Reimplemented from clLightBase.
float clBasalAreaLight::CalcLightValue | ( | clTree * | p_oTree, | |
clTreePopulation * | p_oPop | |||
) | [virtual] |
Gets the light value for a particular tree.
First, it checks to see if the grid has been updated this timestep. If not, then UpdateGridValues() is called. Then the value in the tree's grid cell of the "Basal Area Light" grid is returned.
Implements clLightBase.
float clBasalAreaLight::GetMeanGLI | ( | const float & | fConiferBA, | |
const float & | fAngiospermBA | |||
) | [inline] |
Calculates the mean GLI for a given pair of basal areas.
This is a separate function largely for testing purposes.
fConiferBA | The conifer basal area, in square meters. | |
fAngiospermBA | The angiosperm basal area, in square meters. |
void clBasalAreaLight::UpdateGridValues | ( | clTreePopulation * | p_oPop | ) | [protected] |
Performs the grid updating each timestep.
It totals up angiosperm and conifer basal area within the search radius for each grid cell. It then compares them to the previous timestep's total. For any cell that has changed by more than the change threshold, a new light level is calculated. At the end, this sets m_bGridUpdated to true.
p_oPop | Pointer to the tree population. |
clGridBase* clBasalAreaLight::mp_oLightGrid [protected] |
Grid object which holds the light values.
The name of this grid is "Basal Area Light". It has one float data member called "Light", and two float data members called "Con BA" and "Ang BA", which hold the basal area of conifers and angiosperms, respectively, in the cell. It uses the default grid cell resolution unless otherwise instructed in the parameter file. A map of this grid in the parameter file will be honored.
float* clBasalAreaLight::mp_fStatus [protected] |
The status of each species, as angiosperm or conifer.
float clBasalAreaLight::m_fA [protected] |
The "a" parameter for the mean light function.
float clBasalAreaLight::m_fConiferB [protected] |
The conifer "b" parameter for the mean light function.
float clBasalAreaLight::m_fAngiospermB [protected] |
The angiosperm "b" parameter for the mean light function.
float clBasalAreaLight::m_fConiferC [protected] |
The conifer "c" parameter for the mean light function.
float clBasalAreaLight::m_fAngiospermC [protected] |
The angiosperm "c" parameter for the mean light function.
float clBasalAreaLight::m_fSigma [protected] |
The sigma parameter of the lognormal PDF function.
float clBasalAreaLight::m_fMinDbh [protected] |
The minimum DBH for trees to count towards density in a cell.
float clBasalAreaLight::m_fRadius [protected] |
The search radius for trees.
float clBasalAreaLight::m_fChangeThreshold [protected] |
The amount by which total basal area in a cell has to change in order to trigger a new light calculation.
short int clBasalAreaLight::m_iGridLightCode [protected] |
Return code for the "Light" data member of the "Basal Area Light" grid.
short int clBasalAreaLight::m_iGridConBACode [protected] |
Return code for the "Con BA" data member of the "Basal Area Light" grid.
short int clBasalAreaLight::m_iGridAngBACode [protected] |
Return code for the "Ang BA" data member of the "Basal Area Light" grid.
bool clBasalAreaLight::m_bGridUpdated [protected] |
Whether or not the "Basal Area Light" grid has been updated this timestep.