#include <MortalityBase.h>
Inheritance diagram for clMortalityBase:
Public Member Functions | |
clMortalityBase (clSimManager *p_oSimManager) | |
Constructor. | |
virtual | ~clMortalityBase () |
Destructor. | |
void | Action () |
Performs mortality calculations. | |
virtual bool | DoMort (clTree *p_oTree, const float &fDbh, const short int &iSpecies)=0 |
Determines whether or not a tree dies. | |
clMortalityOrg * | GetMortOrg () |
Gets the mortality org object. | |
void | RegisterTreeDataMembers () |
Triggers the mortality data member registrations. | |
short int | GetNewTreeBools () |
Overridden from clBehaviorBase. | |
bool | UsesThisMortality (short int iSp, short int iTp) |
Whether or not a species/type combo uses this mortality object. | |
virtual void | PreMortCalcs (clTreePopulation *p_oPop) |
Performs calculations before any trees have been killed. | |
Protected Member Functions | |
void | GetData (xercesc::DOMDocument *p_oDoc) |
Triggers all mortality setup. | |
void | PopulateUsesThisMortality () |
Declares and populates the mp_bUsesThisMortality array. | |
virtual void | DoShellSetup (xercesc::DOMDocument *p_oDoc) |
If a descendent class has specific setup needs, it can overload this function. | |
Protected Attributes | |
short int | m_iNumTotalSpecies |
Keep a copy for the constructor. | |
bool | m_bHooked |
Whether or not this shell object is hooked to clMortalityOrg. | |
bool ** | mp_bUsesThisMortality |
2D array, species by type, of whether or not this mortality shell applies to a given species/type combo. | |
Static Protected Attributes | |
static clMortalityOrg * | mp_oMortalityOrg |
clMortalityOrg object. | |
Friends | |
class | clMortalityOrg |
This is the base class for mortality behavior shell classes. These shells each evaluate different kinds mortality for a tree.
The bulk of the organizational work is done by the class clMortalityOrg, which calls the needed shell functions for each tree. The clMortalityOrg object hooks into one particular growth shell object, which calls clMortalityOrg when it is triggered by the behavior manager. It does not particularly matter which shell object is hooked; the first one will suffice. Any non-hooked shells do nothing when their Action() and other functions are called.
Every object made from this class or a descendent class must have the string "mortshell" in its namestring somewhere.
Copyright 2003 Charles D. Canham.
clMortalityBase::clMortalityBase | ( | clSimManager * | p_oSimManager | ) |
Constructor.
Checks to see if the mortality org object has been created - if not, it creates it.
p_oSimManager | Sim Manager object. |
virtual clMortalityBase::~clMortalityBase | ( | ) | [virtual] |
Destructor.
Deletes the growth org object if it was the hooked object.
void clMortalityBase::Action | ( | ) | [virtual] |
Performs mortality calculations.
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 DoGrowthAssignments. Otherwise it does nothing.
Reimplemented from clBehaviorBase.
virtual bool clMortalityBase::DoMort | ( | clTree * | p_oTree, | |
const float & | fDbh, | |||
const short int & | iSpecies | |||
) | [pure virtual] |
Determines whether or not a tree dies.
This must be overridden by all child classes.
p_oTree | Tree being evaluated. It should not be modified, but will be available in case extra data is needed. | |
fDbh | DBH of tree being evaluated - for seedlings will be 0 | |
iSpecies | Species of the tree being evaluated |
Implemented in clAggregatedMortality, clBCMort, clBrowsedStochasticMortality, clCompetitionMort, clDensitySelfThinning, clExpResourceMortality, clGMFMort, clHeightGLIWeibullMortality, clLogisticBiLevelMortality, clNCIMort, clResourceMortality, clSelfThinMort, clSenescence, clStochasticBiLevelMortality, clStochasticMort, and clWeibullSnagMort.
clMortalityOrg* clMortalityBase::GetMortOrg | ( | ) | [inline] |
Gets the mortality org object.
void clMortalityBase::RegisterTreeDataMembers | ( | ) | [virtual] |
Triggers the mortality data member registrations.
If this is the hooked mortality object, then clMortalityOrg::DoDataMemberRegistrations is called.
Reimplemented from clBehaviorBase.
Reimplemented in clNCIMort.
short int clMortalityBase::GetNewTreeBools | ( | ) | [virtual] |
Overridden from clBehaviorBase.
We want to register one bool data member for each species/type combo that is applied to mortality. If this is a hooked object, this calls clMortalityOrg::UpdateDataMemberRegistrations(). Hooked or not, it then returns m_iNewTreeBools as usual.
Reimplemented from clBehaviorBase.
Reimplemented in clNCIMort.
bool clMortalityBase::UsesThisMortality | ( | short int | iSp, | |
short int | iTp | |||
) | [inline] |
Whether or not a species/type combo uses this mortality object.
iSp | Species. | |
iTp | Tree type. |
virtual void clMortalityBase::PreMortCalcs | ( | clTreePopulation * | p_oPop | ) | [inline, virtual] |
Performs calculations before any trees have been killed.
Override this function to perform some processing before any mortality 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 trees will have been killed for mortality. To make this guarantee worth something, DO NOT KILL ANY TREES in this function!
Reimplemented in clAggregatedMortality, and clNCIMort.
void clMortalityBase::GetData | ( | xercesc::DOMDocument * | p_oDoc | ) | [protected, virtual] |
Triggers all mortality setup.
This will be the same for all descendent classes. If a particular object is hooked, it calls the growth org object's DoSetup() function, which calls the function DoShellSetup() - if a descendent class has specific setup needs, it can overload that function.
p_oDoc | DOM tree of parsed input file. |
Implements clWorkerBase.
virtual void clMortalityBase::DoShellSetup | ( | xercesc::DOMDocument * | p_oDoc | ) | [inline, protected, virtual] |
If a descendent class has specific setup needs, it can overload this function.
p_oDoc | DOM tree of parsed input file. |
Reimplemented in clAggregatedMortality, clBCMort, clBrowsedStochasticMortality, clCompetitionMort, clDensitySelfThinning, clExpResourceMortality, clGMFMort, clHeightGLIWeibullMortality, clLogisticBiLevelMortality, clNCIMort, clResourceMortality, clSelfThinMort, clSenescence, clStochasticBiLevelMortality, clStochasticMort, and clWeibullSnagMort.
clMortalityOrg* clMortalityBase::mp_oMortalityOrg [static, protected] |
clMortalityOrg object.
This pointer is held in common by all shells.
short int clMortalityBase::m_iNumTotalSpecies [protected] |
bool clMortalityBase::m_bHooked [protected] |
Whether or not this shell object is hooked to clMortalityOrg.
clMortalityOrg will set this flag.
bool** clMortalityBase::mp_bUsesThisMortality [protected] |
2D array, species by type, of whether or not this mortality shell applies to a given species/type combo.