SORTIE Core C++ Documentation
|
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... | |
clMortalityBase * | GetMortalityShell (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 | |
clTreePopulation * | mp_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... | |
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.
Edit history:
--------------—
October 20, 2011 - Wiped the slate clean for SORTIE 7.0 (LEM)
clMortalityOrg::~clMortalityOrg | ( | ) |
Destructor.
clMortalityOrg::clMortalityOrg | ( | clMortalityBase * | p_oHookedShell | ) |
Constructor.
p_oHookedShell | A clMortalityBase object (a mortality shell object) which then becomes the hooked growth shell object. |
|
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.
p_oSimManager | Sim Manager object. |
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.
p_oHooked | Hooked mortality object. |
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.
|
inline |
Gets a particular mortality shell.
iIndex | Index number of the mortality shell. |
|
inline |
Gets the number of mortality shell objects.
|
inline |
Gets the number of total species.
|
inline |
Gets the number of total tree types.
|
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.
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:
p_oSimManager | Pointer to the simulation manager. Since this object is not descended from clWorkerBase, it does not already have its own pointer. |
p_oHooked | Hooked object |
|
protected |
Number of mortality shell behaviors.
|
protected |
Total number of species.
Should equal the tree pop's value.
|
protected |
Total number of tree types.
Should equal the tree pop's value.
|
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.
|
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).
|
protected |
Array of mortality shell objects, in order of execution.
Each of these shell objects will have a crack at each tree.
|
protected |
Stashed pointer to the tree population object.