#include <GrowthBase.h>
Inheritance diagram for clGrowthBase:
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. | |
clGrowthOrg * | GetGrowthOrg () |
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 clGrowthOrg * | mp_oGrowthOrg |
clGrowthOrg object - this pointer is held in common by all shells | |
Friends | |
class | clGrowthOrg |
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.
|
|
Constructor. The constructor checks to see if the growth org object has been created - if not, it creates it.
|
|
Destructor. The destructor deletes the growth org object if it was the hooked object. |
|
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. |
|
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.
Reimplemented in clAbsoluteGrowth, clConstantBAGrowth, clConstantRadialGrowth, clDoubleMMRelGrowth, clLinearBiLevelGrowth, clLogisticGrowth, clLognormalGrowth, clNCIBAGrowth, clNciGrowth, clPRSemiStochGrowth, clPRStormBiLevelGrowth, clRelativeGrowth, clShadedLinearGrowth, clSimpleLinearGrowth, and clSizeDepLogisticGrowth. |
|
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.
Reimplemented in clGrowthHeightIncrementer, clLogBiLevelGrowth, clLogisticGrowth, clLognormalGrowth, clShadedLinearGrowth, clSimpleLinearGrowth, and clSizeDepLogisticGrowth. |
|
Setup for a descendent class. If a descendent class has specific setup needs, it can overload this function.
Reimplemented in clAbsoluteGrowth, clConstantBAGrowth, clConstantRadialGrowth, clDoubleMMRelGrowth, clGrowthHeightIncrementer, clLinearBiLevelGrowth, clLogBiLevelGrowth, clLogisticGrowth, clLognormalGrowth, clNCIBAGrowth, clNciGrowth, clPRSemiStochGrowth, clPRStormBiLevelGrowth, clRelativeGrowth, clShadedLinearGrowth, clSimpleLinearGrowth, and clSizeDepLogisticGrowth. |
|
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()
Implements clWorkerBase. |
|
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.
Reimplemented in clMichMenBase. |
|
Gets the method by which this behavior increments growth. The possible values are those values in the growthType enum.
|
|
Get the growth org object.
|
|
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 clNCIBAGrowth, and clNciGrowth. |
|
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. |
|
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. |
|
Wwhether or not this shell object is hooked to clGrowthOrg. clGrowthOrg will set this flag. |