clMortalityBase Class Reference

Mortality base - Version 1.1. More...

#include <MortalityBase.h>

Inheritance diagram for clMortalityBase:

clBehaviorBase clWorkerBase clAggregatedMortality clBCMort clBrowsedStochasticMortality clCompetitionMort clDensitySelfThinning clExpResourceMortality clGMFMort clHeightGLIWeibullMortality clLogisticBiLevelMortality clNCIMort clResourceMortality clSelfThinMort clSenescence clStochasticBiLevelMortality clStochasticMort clWeibullSnagMort List of all members.

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.
clMortalityOrgGetMortOrg ()
 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 clMortalityOrgmp_oMortalityOrg
 clMortalityOrg object.

Friends

class clMortalityOrg

Detailed Description

Mortality base - Version 1.1.

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.

Author:
Lora E. Murphy

Edit history:
-----------------
April 28, 2004 - Submitted as beta (LEM)
April 29, 2004 - Updated to version 1.1 by adding a new mortality tree data member code for a death flag
July 21, 2004 - Fixed a bug in data member registrations (LEM)
April 5, 2005 - Added a pre-calculation stage for the sake of NCI (LEM)


Constructor & Destructor Documentation

clMortalityBase::clMortalityBase ( clSimManager p_oSimManager  ) 

Constructor.

Checks to see if the mortality org object has been created - if not, it creates it.

Parameters:
p_oSimManager Sim Manager object.

virtual clMortalityBase::~clMortalityBase (  )  [virtual]

Destructor.

Deletes the growth org object if it was the hooked object.


Member Function Documentation

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.

Parameters:
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
Returns:
True if the tree is to die, false if it lives.

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.

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

Returns:
Number of new tree bools, or zero if no new members are to be registered.

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.

Parameters:
iSp Species.
iTp Tree type.
Returns:
True if this combo uses this mortality object, false if not.

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.

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

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


Member Data Documentation

clMortalityOrg* clMortalityBase::mp_oMortalityOrg [static, protected]

clMortalityOrg object.

This pointer is held in common by all shells.

short int clMortalityBase::m_iNumTotalSpecies [protected]

Keep a copy for the constructor.

Reimplemented in clSenescence.

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.


The documentation for this class was generated from the following file:
Generated on Thu May 24 09:30:44 2007 for SORTIE Core C++ Documentation by  doxygen 1.5.2