clTreeAgeCalculator Class Reference

Tree age calculator, version 1.0. More...

#include <TreeAgeCalculator.h>

Inheritance diagram for clTreeAgeCalculator:

clBehaviorBase clWorkerBase

List of all members.

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 tree age.
int m_iNumSpecies
 Number of species, for destructor.


Detailed Description

Tree age calculator, version 1.0.

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.

Author:
Lora E. Murphy

Edit history:
-----------------
November 21, 2005 - Created (LEM)

Constructor & Destructor Documentation

clTreeAgeCalculator::clTreeAgeCalculator ( clSimManager p_oSimManager  ) 

Constructor.

clTreeAgeCalculator::~clTreeAgeCalculator (  ) 

Destructor.

Frees memory.


Member Function Documentation

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.

Parameters:
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.

Exceptions:
modelErr if this behavior is being applied to any tree type except seedlings, saplings, and adults.

Reimplemented from clBehaviorBase.


Member Data Documentation

short int** clTreeAgeCalculator::mp_iAgeCodes [protected]

Data member codes for "Tree Age" data member.

First array index is # species, second is number types

char* clTreeAgeCalculator::m_cQuery [protected]

String to pass to clTreePopulation::Find() in order to get the trees for which to calculate tree age.

This will instigate a species/type search for all the species and types to which this behavior applies.

Number of species, for destructor.


The documentation for this class was generated from the following file:

Generated on Tue Apr 19 13:56:18 2011 for SORTIE Core C++ Documentation by  doxygen 1.5.6