#include <TreeAgeCalculator.h>
Inheritance diagram for clTreeAgeCalculator:
Public Member Functions | |
clTreeAgeCalculator (clSimManager *p_oSimManager) | |
Constructor. | |
~clTreeAgeCalculator () | |
Destructor. | |
void | Action () |
Updates ages. | |
void | GetData (xercesc::DOMDocument *p_oDoc) |
Does setup for this behavior. | |
void | RegisterTreeDataMembers () |
Registers the "Tree Age" int data member. | |
Protected Attributes | |
short int ** | mp_iAgeCodes |
Data member codes for "Tree Age" data member. | |
char * | m_cQuery |
String to pass to clTreePopulation::Find() in order to get the trees for which to calculate volume. | |
int | m_iNumSpecies |
Number of species, for destructor. |
This behavior tracks tree age. It adds an int data member to the tree called "Tree Age", and increments it each timestep with the number of years per timestep. Thus "Tree Age" holds the tree's age, in years.
In order to distinguish initial conditions trees, they are all set to ages of 10000.
This behavior should execute towards the end of a run, after establishment. This way seedlings don't have an age of 0 at the end of the timestep.
This behavior can only be applied to seedlings, saplings, and adults, since the meaning of "age" for snags is debatable.
The namestring and parameter file call string for this behavior are both "Tree Age Calculator".
Copyright 2005 Charles D. Canham.
clTreeAgeCalculator::~clTreeAgeCalculator | ( | ) |
Destructor.
Frees memory.
void clTreeAgeCalculator::Action | ( | ) | [virtual] |
Updates ages.
A query is sent to the tree population to get all trees to which this behavior is applied.
Reimplemented from clBehaviorBase.
void clTreeAgeCalculator::GetData | ( | xercesc::DOMDocument * | p_oDoc | ) | [virtual] |
Does setup for this behavior.
It formats a query string for finding trees to which this behavior applies. It then finds any initial conditions trees, and if they do not have an age specified, sets their age to 10000.
p_oDoc | DOM tree of parsed input file. |
Implements clWorkerBase.
void clTreeAgeCalculator::RegisterTreeDataMembers | ( | ) | [virtual] |
Registers the "Tree Age" int data member.
The return codes are captured in the mp_iAgeCodes array.
modelErr | if this behavior is being applied to any tree type except seedlings, saplings, and adults. |
Reimplemented from clBehaviorBase.
char* clTreeAgeCalculator::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.
short int** clTreeAgeCalculator::mp_iAgeCodes [protected] |
Data member codes for "Tree Age" data member.
First array index is # species, second is number types