clMortalityOrg Class Reference

Mortality org - Version 1.1. More...

#include <MortalityOrg.h>

List of all members.

Public Member Functions

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

Protected Member Functions

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

Protected Attributes

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


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:
-----------------
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 (LEM)
July 22, 2004 - Bug fix in data member registrations (LEM)
February 8, 2008 - Changed mortality flags from simple booleans to reason codes (LEM)

Constructor & Destructor Documentation

clMortalityOrg::~clMortalityOrg (  ) 

Destructor.

clMortalityOrg::clMortalityOrg ( clMortalityBase p_oHookedShell  ) 

Constructor.

Parameters:
p_oHookedShell A clMortalityBase object (a mortality shell object) which then becomes the hooked growth shell object.


Member Function Documentation

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.

short int clMortalityOrg::GetNumberOfSpecies (  )  [inline]

Gets the number of total species.

Returns:
Total number of species.

short int clMortalityOrg::GetNumberOfTypes (  )  [inline]

Gets the number of total tree types.

Returns:
Total number of tree types.

short int clMortalityOrg::GetNumberOfMortalityShells (  )  [inline]

Gets the number of mortality shell objects.

Returns:
Number of mortality shell objects.

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_oHooked Hooked mortality object.

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_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

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

Gets a particular mortality shell.

Parameters:
iIndex Index number of the mortality shell.
Returns:
Mortality shell at that index.

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_oSimManager Sim Manager object.

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.


Member Data Documentation

Stashed pointer to the tree population object.

Array of mortality shell objects, in order of execution.

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

short int clMortalityOrg::m_iTotalSpecies [protected]

Total number of species.

Should equal the tree pop's value.

short int clMortalityOrg::m_iTotalTypes [protected]

Total number of tree types.

Should equal the tree pop's value.

short int clMortalityOrg::m_iNumMortShells [protected]

Number of mortality shell behaviors.

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).

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.


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

Generated on Tue Apr 19 13:56:13 2011 for SORTIE Core C++ Documentation by  doxygen 1.5.6