SORTIE Core C++ Documentation
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
clMortalityOrg Class Reference

Mortality org - Version 1.1. More...

#include <MortalityOrg.h>

Public Member Functions

 ~clMortalityOrg ()
 Destructor. More...
 
 clMortalityOrg (clMortalityBase *p_oHookedShell)
 Constructor. More...
 
void DoMortality ()
 Performs mortality calculations. More...
 
short int GetNumberOfSpecies ()
 Gets the number of total species. More...
 
short int GetNumberOfTypes ()
 Gets the number of total tree types. More...
 
short int GetNumberOfMortalityShells ()
 Gets the number of mortality shell objects. More...
 
void DoDataMemberRegistrations (clMortalityBase *p_oHooked)
 Registers the mortality data member. More...
 
void UpdateDataMemberRegistrations (clSimManager *p_oSimManager, clMortalityBase *p_oHooked)
 Tells the mortality behaviors how many new tree bools to report to the tree population. More...
 
clMortalityBaseGetMortalityShell (short int iIndex)
 Gets a particular mortality shell. More...
 

Protected Member Functions

void AssembleMortShellList (clSimManager *p_oSimManager)
 Populates the mortality shell array with the appropriate behavior pointers. More...
 
void PopulateUsesMortality ()
 Sets which species/type combos use which mortality. More...
 

Protected Attributes

clTreePopulationmp_oPop
 Stashed pointer to the tree population object. More...
 
clMortalityBase ** mp_oMortShellList
 Array of mortality shell objects, in order of execution. More...
 
short int m_iTotalSpecies
 Total number of species. More...
 
short int m_iTotalTypes
 Total number of tree types. More...
 
short int m_iNumMortShells
 Number of mortality shell behaviors. More...
 
short int ** mp_iDeadCodes
 Return codes for the "dead" tree int data member variable. More...
 
bool ** mp_bUsesMortality
 2-D array - species by type - of whether or not a species/type combo uses mortality. More...
 

Detailed Description

Mortality org - Version 1.1.

This class does the organizational work for tree mortaliy for a timestep. It hooks into a mortality shell object and is triggered by that object when the shell is triggered by the behavior manager.

An object of this class will then call each tree and, if any mortality applies, all mortality shell objects in turn will get a crack at the tree until the tree's marked for death or until it has completely run the gauntlet.

Any tree specie/type combination to which any mortality behavior has been applied will have a new bool data member called "dead" registered for it. The mortality process does not actually kill the trees, but puts a value of true in that "dead" data member. Trees with this flag will be removed later by the clRemoveTrees object, if it exists.

Copyright 2003 Charles D. Canham.

Author
Lora E. Murphy


Edit history:
--------------—
October 20, 2011 - Wiped the slate clean for SORTIE 7.0 (LEM)

Constructor & Destructor Documentation

◆ ~clMortalityOrg()

clMortalityOrg::~clMortalityOrg ( )

Destructor.

◆ clMortalityOrg()

clMortalityOrg::clMortalityOrg ( clMortalityBase p_oHookedShell)

Constructor.

Parameters
p_oHookedShellA clMortalityBase object (a mortality shell object) which then becomes the hooked growth shell object.

Member Function Documentation

◆ AssembleMortShellList()

void clMortalityOrg::AssembleMortShellList ( clSimManager p_oSimManager)
protected

Populates the mortality shell array with the appropriate behavior pointers.

It does this by going through the behaviors and looking for the ones with "mortshell" in their names.

Parameters
p_oSimManagerSim Manager object.

◆ DoDataMemberRegistrations()

void clMortalityOrg::DoDataMemberRegistrations ( clMortalityBase p_oHooked)

Registers the mortality data member.

Registers a "dead" boolean data member for each species/type combo that uses mortality, and resets the hooked object's species/type combos. This is called by the hooked object's RegisterTreeDataMembers() function.

Parameters
p_oHookedHooked mortality object.

◆ DoMortality()

void clMortalityOrg::DoMortality ( )

Performs mortality calculations.

This will control the application of the mortality shells to the individual trees. If a tree's species/type combo bucket in mp_bUsesMortality is set to true, then the tree goes through the gauntlet. This should be called each timestep by the hooked shell's Action() function.

◆ GetMortalityShell()

clMortalityBase* clMortalityOrg::GetMortalityShell ( short int  iIndex)
inline

Gets a particular mortality shell.

Parameters
iIndexIndex number of the mortality shell.
Returns
Mortality shell at that index.

◆ GetNumberOfMortalityShells()

short int clMortalityOrg::GetNumberOfMortalityShells ( )
inline

Gets the number of mortality shell objects.

Returns
Number of mortality shell objects.

◆ GetNumberOfSpecies()

short int clMortalityOrg::GetNumberOfSpecies ( )
inline

Gets the number of total species.

Returns
Total number of species.

◆ GetNumberOfTypes()

short int clMortalityOrg::GetNumberOfTypes ( )
inline

Gets the number of total tree types.

Returns
Total number of tree types.

◆ PopulateUsesMortality()

void clMortalityOrg::PopulateUsesMortality ( )
protected

Sets which species/type combos use which mortality.

This will go through each of the mortality shells in mp_oMortShellList and use the species/type combos they apply to to set the appropriate bucket in mp_bUsesMortality to true.

◆ UpdateDataMemberRegistrations()

void clMortalityOrg::UpdateDataMemberRegistrations ( clSimManager p_oSimManager,
clMortalityBase p_oHooked 
)

Tells the mortality behaviors how many new tree bools to report to the tree population.

Tree species/type combos are likely to have multiple mortality behaviors applied to them. If each behavior added a bool, then there would be too many. Here's what this function does:

  1. Collects its list of mortality objects.
  2. Cause each mortality behavior to populate its mp_bUsesThisMortality table.
  3. Analyze the behaviors and come up with which species/type combos have any mortality applied.
  4. Assign those species/type combos to the hooked object and tell it to register one bool data member. The hooked object will already have its mp_bUsesThisMortality table populated, so it shouldn't matter that we've changed its assigned combos.
Parameters
p_oSimManagerPointer to the simulation manager. Since this object is not descended from clWorkerBase, it does not already have its own pointer.
p_oHookedHooked object

Member Data Documentation

◆ m_iNumMortShells

short int clMortalityOrg::m_iNumMortShells
protected

Number of mortality shell behaviors.

◆ m_iTotalSpecies

short int clMortalityOrg::m_iTotalSpecies
protected

Total number of species.

Should equal the tree pop's value.

◆ m_iTotalTypes

short int clMortalityOrg::m_iTotalTypes
protected

Total number of tree types.

Should equal the tree pop's value.

◆ mp_bUsesMortality

bool** clMortalityOrg::mp_bUsesMortality
protected

2-D array - species by type - of whether or not a species/type combo uses mortality.

This array determines whether a tree is fed to the mortality gauntlet.

◆ mp_iDeadCodes

short int** clMortalityOrg::mp_iDeadCodes
protected

Return codes for the "dead" tree int data member variable.

Array size is number of species by number of tree types (even if not every species and type is represented).

◆ mp_oMortShellList

clMortalityBase** clMortalityOrg::mp_oMortShellList
protected

Array of mortality shell objects, in order of execution.

Each of these shell objects will have a crack at each tree.

◆ mp_oPop

clTreePopulation* clMortalityOrg::mp_oPop
protected

Stashed pointer to the tree population object.


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