clGrowthBase Class Reference

Base class for behaviors that implement tree growth. More...

#include <GrowthBase.h>

Inheritance diagram for clGrowthBase:

clBehaviorBase clWorkerBase clAllometricGrowthIncrementer clBrowsedRelativeGrowth clLaggedPostHarvestGrowth clLinearBiLevelGrowth clLogBiLevelGrowth clLogisticGrowth clLognormalGrowth clMichMenBase clMichMenNegGrowth clMichMenPhotoinhibition clNCIBAGrowth clNciGrowth clPowerHeightGrowth clPRSemiStochGrowth clPRStormBiLevelGrowth clShadedLinearGrowth clSimpleLinearGrowth clSizeDepLogisticGrowth

List of all members.

Public Types

enum  growthType { diameter_auto, diameter_only, height_only }
 Values describing the method by which the object instance of this class plans to implement tree growth. More...

Public Member Functions

 clGrowthBase (clSimManager *p_oSimManager)
 Constructor.
virtual ~clGrowthBase ()
 Destructor.
void Action ()
 Performs all growth calculations if "hooked".
virtual float CalcDiameterGrowthValue (clTree *p_oTree, clTreePopulation *p_oPop, float fHeightGrowth)
 Calculates the amount of diameter growth increase for a particular tree, if applicable.
virtual float CalcHeightGrowthValue (clTree *p_oTree, clTreePopulation *p_oPop, float fDiameterGrowth)
 Calculates the amount of height growth increase for a particular tree, if applicable.
virtual float GetGrowthMemberValue (clTree *p_oTree, float fDiameterGrowth)
 Calculates the value to go into a tree's "Growth" data member as the amount of growth.
virtual void PreGrowthCalcs (clTreePopulation *p_oPop)
 Performs calculations before any DBHs have been changed.
growthType GetGrowthMethod ()
 Gets the method by which this behavior increments growth.
clGrowthOrgGetGrowthOrg ()
 Get the growth org object.
void RegisterTreeDataMembers ()
 Performs data member registrations for "Growth".

Protected Member Functions

void GetData (xercesc::DOMDocument *p_oDoc)
 Triggers all growth setup if an object is hooked.
virtual void DoShellSetup (xercesc::DOMDocument *p_oDoc)
 Setup for a descendent class.

Protected Attributes

growthType m_iGrowthMethod
 The method by which this object plans to update tree dimensions.
float m_fConvertCmPerTSToMmPerYr
 Conversion factor from cm diameter growth per timestep to mm radial growth per year.
float m_fConvertMmPerYearToCmPerTS
 Conversion factor to take amounts from mm of radial growth per year to cm of diameter growth per timestep.
bool m_bHooked
 Wwhether or not this shell object is hooked to clGrowthOrg.
bool m_bGoLast
 Whether or not this behavior's growth should go last when used with a complementary growth behavior.

Static Protected Attributes

static clGrowthOrgmp_oGrowthOrg
 clGrowthOrg object - this pointer is held in common by all shells

Friends

class clGrowthOrg


Detailed Description

Base class for behaviors that implement tree growth.

Tree growth is the change of a tree's diameter and/or height. (The normal method is to increase these dimensions. This class has not been tested with code that causes trees to shrink.)

There are two ways to change a tree's size. The first method is to increment the tree's diameter, and allow the tree population to automatically change the height to match. The second method is to increment the diameter and height separately and explicitly, and override the tree population's auto-update of the other dimension. This base class can accommodate child classes that use either method. Each object of each child class is responsible for figuring out how the user intends it to work and setting the appropriate flags, especially if it can work by either method.

Sometimes growth behaviors need to make calculations before any DBHs have been incremented; for instance, neighborhood competition growth behaviors need to be assured that no trees have been changed when performing these calculations. If a growth behavior has to make these sorts of calculations, it can override the PreGrowthCalcs() function.

Classes descended from this class are referred to as shell classes. (That's my term - there's probably a better one.) This is because these child classes don't function as standalone behaviors, but leave the organizational work to another class (clGrowthOrg). The clGrowthOrg class coordinates the efforts of all objects of the shell classes for maximum efficiency.

Since clGrowthOrg is not descended from clBehaviorBase, it doesn't receive the triggers from the simulation manager that tell it when to work (calls to GetData(), Action(), etc). So, one shell object (any one, it doesn't matter which) is "hooked" to clGrowthOrg. When it receives the triggers from clSimManager, it passes them on to clGrowthOrg for processing. All other shells ignore these triggers, since they receive their instructions from clGrowthOrg.

Every object made from this class or a descendent class must have the string "growthshell" in its namestring somewhere, to identify it as a shell object.

This base class also declares a new tree float data member on behalf of each child shell object; the growth org object then registers it. The descendents don't need to do anything. The new data member is called "Growth", and will store the amount of diameter growth in mm/yr calculated.

You cannot create an object that is an instance of this class, although you can certainly cast pointers to instances of child classes to be of type clGrowthBase if needed.

Copyright 2003 Charles D. Canham.

Author:
Lora E. Murphy

Edit history:
-----------------
April 28, 2004 - Submitted as beta (LEM)
May 21, 2004 - Added support for separate diameter / height increments (LEM)
February 24, 2005 - Added new data member "Growth" to replace "lgm" (LEM)

Member Enumeration Documentation

Values describing the method by which the object instance of this class plans to implement tree growth.

Enumerator:
diameter_auto  The object calculates a diameter increase, and the height update is left to the tree population's auto-update process.
diameter_only  The object sets a diameter increase only.

The height should be set manually by another object.

height_only  The object sets a height increase only.

The diameter should be set manually by another object.


Constructor & Destructor Documentation

clGrowthBase::clGrowthBase ( clSimManager p_oSimManager  ) 

Constructor.

The constructor checks to see if the growth org object has been created - if not, it creates it.

Parameters:
p_oSimManager Sim Manager object.

virtual clGrowthBase::~clGrowthBase (  )  [virtual]

Destructor.

The destructor deletes the growth org object if it was the hooked object.


Member Function Documentation

void clGrowthBase::Action (  )  [virtual]

Performs all growth calculations if "hooked".

This function is the same for all descendent classes - they do not need to override it (in fact, they can't). If a particular object is hooked, it calls mp_oGrowthOrg's DoGrowthAssignments function. Otherwise it does nothing.

Reimplemented from clBehaviorBase.

virtual float clGrowthBase::CalcDiameterGrowthValue ( clTree p_oTree,
clTreePopulation p_oPop,
float  fHeightGrowth 
) [inline, virtual]

Calculates the amount of diameter growth increase for a particular tree, if applicable.

If overridden, this function must not change the tree's diameter (clGrowthOrg will do that).

REMEMBER to appropriately compound growth by the number of years per timestep!

The tree being passed will NOT yet have had any growth applied to it.

Parameters:
p_oTree Tree for which to calculate growth.
p_oPop Tree population object, just in case it's needed.
fHeightGrowth Amount of height growth, in m. ONLY USE if this behavior has set m_bGoLast to true; otherwise this value will not be useful.
Returns:
Amount, in cm, by which to increase the tree's diameter.

Reimplemented in clAbsoluteGrowth, clAllometricGrowthIncrementer, clBrowsedRelativeGrowth, clConstantBAGrowth, clConstantRadialGrowth, clDoubleMMRelGrowth, clLaggedPostHarvestGrowth, clLinearBiLevelGrowth, clLogisticGrowth, clLognormalGrowth, clNCIBAGrowth, clNciGrowth, clPRSemiStochGrowth, clPRStormBiLevelGrowth, clRelativeGrowth, clShadedLinearGrowth, clSimpleLinearGrowth, and clSizeDepLogisticGrowth.

virtual float clGrowthBase::CalcHeightGrowthValue ( clTree p_oTree,
clTreePopulation p_oPop,
float  fDiameterGrowth 
) [inline, virtual]

Calculates the amount of height growth increase for a particular tree, if applicable.

If overridden, this function must not change the tree's height (clGrowthOrg will do that).

REMEMBER to appropriately compound growth by the number of years per timestep!

The tree being passed will NOT yet have had any growth applied to it.

Parameters:
p_oTree Tree for which to calculate growth.
p_oPop Tree population object, just in case it's needed.
fDiameterGrowth Amount of diameter growth for this tree, in cm.
Returns:
Amount, in m, by which to increase the tree's height.

Reimplemented in clAllometricGrowthIncrementer, clLogBiLevelGrowth, clLogisticGrowth, clLognormalGrowth, clMichMenNegGrowth, clMichMenPhotoinhibition, clPowerHeightGrowth, clRelativeGrowth, clShadedLinearGrowth, clSimpleLinearGrowth, and clSizeDepLogisticGrowth.

virtual float clGrowthBase::GetGrowthMemberValue ( clTree p_oTree,
float  fDiameterGrowth 
) [inline, virtual]

Calculates the value to go into a tree's "Growth" data member as the amount of growth.

If overridden, this function must not change the tree's "Growth" data member (clGrowthOrg will do that). This will only be called if this behavior was the diameter incrementer (either diameter_auto or diameter_only) for the tree being passed.

The tree being passed will NOT yet have had any growth applied to it.

Parameters:
p_oTree Tree to get "Growth" for.
fDiameterGrowth Amount of diameter growth to be added, in mm per year.
Returns:
Value to place in "Growth".

Reimplemented in clMichMenBase.

virtual void clGrowthBase::PreGrowthCalcs ( clTreePopulation p_oPop  )  [inline, virtual]

Performs calculations before any DBHs have been changed.

Override this function to perform some processing before any growth change has been applied. There are no guarantees as to what order the behaviors will be called for this function, but it is guaranteed that no growth incrementing has been applied. To make this guarantee worth something, DO NOT CHANGE ANY TREE SIZE VALUES in this function!

Reimplemented in clLaggedPostHarvestGrowth, clNCIBAGrowth, and clNciGrowth.

growthType clGrowthBase::GetGrowthMethod (  )  [inline]

Gets the method by which this behavior increments growth.

The possible values are those values in the growthType enum.

Returns:
Growth method, as diameter_only, diameter_auto, or height_only.

clGrowthOrg* clGrowthBase::GetGrowthOrg (  )  [inline]

Get the growth org object.

Returns:
Growth org object.

void clGrowthBase::RegisterTreeDataMembers (  )  [virtual]

Performs data member registrations for "Growth".

This will be the same for all descendent classes - they do not need to override. If a particular object is hooked, it calls the growth org object's DoTreeDataMemberRegistrations(). Otherwise it does nothing.

Reimplemented from clBehaviorBase.

Reimplemented in clAbsoluteGrowth, and clLaggedPostHarvestGrowth.

void clGrowthBase::GetData ( xercesc::DOMDocument *  p_oDoc  )  [protected, virtual]

Triggers all growth setup if an object is hooked.

This will be the same for all descendent classes. If a particular object is hooked, it calls mp_oGrowthOrg's DoSetup() function, which calls the function DoShellSetup()

  • if a descendent class has specific setup needs, it can overload that function.

Parameters:
p_oDoc DOM tree of parsed input file.

Implements clWorkerBase.

virtual void clGrowthBase::DoShellSetup ( xercesc::DOMDocument *  p_oDoc  )  [inline, protected, virtual]


Friends And Related Function Documentation

friend class clGrowthOrg [friend]


Member Data Documentation

clGrowthOrg object - this pointer is held in common by all shells

The method by which this object plans to update tree dimensions.

Conversion factor from cm diameter growth per timestep to mm radial growth per year.

Conversion factor to take amounts from mm of radial growth per year to cm of diameter growth per timestep.

bool clGrowthBase::m_bHooked [protected]

Wwhether or not this shell object is hooked to clGrowthOrg.

clGrowthOrg will set this flag.

bool clGrowthBase::m_bGoLast [protected]

Whether or not this behavior's growth should go last when used with a complementary growth behavior.

Some height-incrementing growth behaviors depend on the results of the growth-incrementers, and vice-versa. If this behavior is diam-with-auto-height growth, this flag is ignored. If separate growth and height behaviors are used, precedence is as follows: if one behavior requests to be last and the other does not, then the behavior that wants to go last will do so. If both of these flags are false or both are true, height-only behaviors win and get to go last. This defaults to false.


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

Generated on Wed Oct 28 13:58:46 2009 for SORTIE Core C++ Documentation by  doxygen 1.5.6