#include <GapLight.h>
Inheritance diagram for clGapLight:
Public Member Functions | |
clGapLight (clSimManager *p_oSimManager) | |
Constructor. | |
void | DoShellSetup (xercesc::DOMDocument *p_oDoc) |
Sets up the "Gap light" grid. | |
float | CalcLightValue (clTree *p_oTree, clTreePopulation *p_oPop) |
Provides a GLI value for a tree. | |
void | TimestepCleanup () |
Sets m_bCalcedGaps = false. | |
Protected Member Functions | |
void | CalculateGapStatus (clTreePopulation *p_oPop) |
Updates the gap status of the "Gap Light" grid. | |
Protected Attributes | |
clGridBase * | mp_oGapGrid |
Grid object which holds the gap values, called "Gap Light". | |
short int | m_iGapCode |
Return code for the "Is Gap" member of the "Gap Light" grid to get and set GLI in the cells. | |
bool | m_bCalcedGaps |
Whether or not the gap status has been calculated for this timestep. |
This behavior simplifies GLI calculations by treating GLI as binary: either an area is in gap, and GLI = 100% (full sun), or an area is not in gap, and GLI = 0% (no sun).
This behavior uses a grid object, called "Gap Light", to help it assign GLI values to the trees to which it is assigned. The presence of an adult tree in a cell of "Gap Light" causes that cell's status to be non-gap. The absence of any adult trees in a cell causes it to be gap. For all trees to which this behavior is assigned, if they are in a gap cell, their GLI is set to 100%; otherwise it is 0%.
The namestring is "gaplightshell". The parameter file call string is "Gap Light".
Copyright 2003 Charles D. Canham.
clGapLight::clGapLight | ( | clSimManager * | p_oSimManager | ) |
Constructor.
Sets the namestring.
p_oSimManager | Sim Manager object. |
void clGapLight::DoShellSetup | ( | xercesc::DOMDocument * | p_oDoc | ) | [virtual] |
Sets up the "Gap light" grid.
p_oDoc | DOM tree of parsed input file (not used). |
modelErr | if the grid is incorrectly set up in the parameter file. |
Reimplemented from clLightBase.
float clGapLight::CalcLightValue | ( | clTree * | p_oTree, | |
clTreePopulation * | p_oPop | |||
) | [virtual] |
Provides a GLI value for a tree.
This starts by determining if the gap status has been updated for the timestep (is m_bCalcedGaps = false); if not, then it calls CalculateGapStatus. If the tree is in a gap cell with no adult trees present, the value is 100; otherwise it is 0.
p_oTree | Tree for which to get GLI. | |
p_oPop | Tree population object. |
Implements clLightBase.
void clGapLight::CalculateGapStatus | ( | clTreePopulation * | p_oPop | ) | [protected] |
Updates the gap status of the "Gap Light" grid.
It asks the tree population for all parent trees; for each tree, the grid cell in which it is is set to gap.
p_oPop | Tree population object. |
clGridBase* clGapLight::mp_oGapGrid [protected] |
Grid object which holds the gap values, called "Gap Light".
It has one bool data member called "Is Gap" for holding the gap status, either TRUE (if there are adults in that cell) or FALSE (if there are not).
A map in the parameter file can only set cell resolution; any values in the map will be ignored.
short int clGapLight::m_iGapCode [protected] |
Return code for the "Is Gap" member of the "Gap Light" grid to get and set GLI in the cells.
bool clGapLight::m_bCalcedGaps [protected] |
Whether or not the gap status has been calculated for this timestep.