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

Substrate Dependent Seed Survival - Version 1.1. More...

#include <SubstrateDepSeedSurvival.h>

Inheritance diagram for clSubstrateDepSeedSurvival:
clBehaviorBase clWorkerBase

Public Member Functions

 clSubstrateDepSeedSurvival (clSimManager *p_oSimManager)
 Constructor. More...
 
 ~clSubstrateDepSeedSurvival ()
 Destructor. More...
 
void GetData (xercesc::DOMDocument *p_oDoc)
 Performs setup. More...
 
void Action ()
 Assesses seed survival. More...
 
void SetNameData (std::string sNameString)
 Captures the behavior name passed from the parameter file. More...
 
- Public Member Functions inherited from clBehaviorBase
virtual float GetBehaviorVersion ()
 Gets the behavior version number. More...
 
 clBehaviorBase (clSimManager *p_oSimManager)
 Constructor. More...
 
virtual ~clBehaviorBase ()
 Destructor. More...
 
virtual short int ValidateVersionNumber (float fTestVersion)
 Makes sure that the version number of a file passed is between the minimum and current version numbers. More...
 
virtual void RegisterTreeDataMembers ()
 Registers tree data members. More...
 
virtual void SetSpeciesTypeCombos (short int iNumCombos, stcSpeciesTypeCombo *p_whatCombos)
 Sets the species/type combos for a behavior. More...
 
virtual short int GetNewTreeInts ()
 Gets the number of new tree integer data members this behavior wants to register. More...
 
virtual short int GetNewTreeFloats ()
 Gets the number of new tree float data members this behavior wants to register. More...
 
virtual short int GetNewTreeChars ()
 Gets the number of new tree character data members this behavior wants to register. More...
 
virtual short int GetNewTreeBools ()
 Gets the number of new tree bool data members this behavior wants to register. More...
 
virtual short int GetNumSpeciesTypeCombos ()
 Gets the number of species/type combos to which this behavior applies. More...
 
virtual short int GetNumBehaviorSpecies ()
 Gets the number of unique tree species to which this behavior applies. More...
 
struct stcSpeciesTypeCombo GetSpeciesTypeCombo (short int iIndex)
 Gets one of this behavior's type/species combos. More...
 
virtual short int GetBehaviorSpecies (short int iIndex)
 Gets one of the behavior's species. More...
 
short int GetBehaviorListNumber ()
 Gets the behavior list number for this behavior, which differentiates between multiple copies of the behavior in the behavior list. More...
 
void SetBehaviorListNumber (short int iNumber)
 Sets the behavior list number for this behavior, which differentiates between multiple copies of the behavior in the behavior list. More...
 
std::string FormatSpeciesTypeQueryString ()
 Formats the string for species/types query. More...
 
virtual DOMElement * GetParentParametersElement (xercesc::DOMDocument *p_oDoc)
 This will get the correct set of parameters for this behavior based on the behavior list position number. More...
 
- Public Member Functions inherited from clWorkerBase
 clWorkerBase (clSimManager *p_oSimManager)
 Constructor. More...
 
virtual ~clWorkerBase ()
 Destructor. More...
 
std::string GetName ()
 Gets the object's namestring. More...
 
clSimManagerGetSimManager ()
 
void DoObjectSetup (xercesc::DOMDocument *p_oDoc, fileType iFileType)
 Triggers the setup process. More...
 
virtual void TimestepCleanup ()
 Performs any necessary cleanup operations at the end of a timestep. More...
 
virtual void EndOfRunCleanup ()
 Performs any necessary cleanup operations at the end of a run. More...
 

Protected Member Functions

void GetParameterFileData (xercesc::DOMDocument *p_oDoc)
 Declares arrays and fills them with parameter file data. More...
 
void CalculateSubstrateFavorabilityIndex ()
 For each grid cell in the substrate favorability grid, determines its substrate favorability index. More...
 
void SetupGrids ()
 Sets up the grids. More...
 
- Protected Member Functions inherited from clWorkerBase
void AssembleFileCode (int iFileType, int iFileVersion, char *cCode)
 Creates the proper identifying filecode for an XML file. More...
 

Protected Attributes

clGridmp_oSubstrateGrid
 Pointer to "Substrate" grid, created by clSubstrate. More...
 
clGridmp_oSubstrateFavGrid
 The grid called "Substrate Favorability" will have a cell resolution matching the "Substrate" grid. More...
 
clGridmp_oSeedGrid
 Pointer to the "Dispersed Seeds" grid created by disperse behaviors. More...
 
double * mp_fCanGroundScarSoilFav
 Canopy / ground scarified soil favorability - one per behavior species. More...
 
double * mp_fCanGroundTipUpFav
 Canopy / ground tip-up mounds favorability - one per behavior species. More...
 
double * mp_fCanGroundFreshLogFav
 Canopy / ground fresh logs favorability - one per behavior species. More...
 
double * mp_fCanGroundDecLogFav
 Canopy / ground decayed logs favorability - one per behavior species. More...
 
double * mp_fCanGroundForFlLitterFav
 Canopy / ground forest floor litter favorability - one per behavior species. More...
 
double * mp_fCanGroundForFlMossFav
 Canopy / ground forest floor moss favorability - one per behavior species. More...
 
double * mp_fGapMoundScarSoilFav
 Gap / mound scarified soil favorability - one per behavior species. More...
 
double * mp_fGapMoundTipUpFav
 Gap / mound tip-up mounds favorability - one per behavior species. More...
 
double * mp_fGapMoundFreshLogFav
 Gap / mound fresh logs favorability - one per behavior species. More...
 
double * mp_fGapMoundDecLogFav
 Gap / mound decayed logs favorability - one per behavior species. More...
 
double * mp_fGapMoundForFlLitterFav
 Gap / mound forest floor litter favorability - one per behavior species. More...
 
double * mp_fGapMoundForFlMossFav
 Gap / mound forest floor moss favorability - one per behavior species. More...
 
short int * mp_iIndexes
 Speeds access to favorability arrays. More...
 
short int * mp_iSubstrFavCode
 Data member codes for substrate grid for favorability index. More...
 
short int * mp_iSeedGridCode
 Data member codes for seed grid for number of seeds. More...
 
double m_fMoundProp
 Proportion of plot that is mound, if using microtopography - 0 - 1. More...
 
short int m_iIsGapCode
 Data member code for gap status in dispersed seed grid. More...
 
short int m_iScarifiedSoilCode
 Data member code - float - scarsoil grid data member. More...
 
short int m_iForestFloorLitterCode
 Data member code - float - fflitter grid data member. More...
 
short int m_iForestFloorMossCode
 Data member code - float - ffmoss grid data member. More...
 
short int m_iTipUpCode
 Data member code - float - tipup grid data member. More...
 
short int m_iFreshLogCode
 Data member code - float - freshlog grid data member. More...
 
short int m_iDecayedLogCode
 Data member code - float - declog grid data member. More...
 
bool m_bUsesGap
 Whether or not gap status is used by this behavior. More...
 
bool m_bUsesMicro
 Whether or not microtopography is used. More...
 
- Protected Attributes inherited from clBehaviorBase
short int m_iNumSpeciesTypeCombos
 How many type/species combos a behavior will act on. More...
 
short int m_iNumBehaviorSpecies
 How many distinct species are in the combo list - important for filling species-specific values from parameter file. More...
 
short int * mp_iWhatSpecies
 List of distinct species - for filling species-specific values from parameter file. More...
 
stcSpeciesTypeCombomp_whatSpeciesTypeCombos
 Array of species/type combos that the behavior will act on. More...
 
short int m_iNewTreeInts
 The number of new tree integer data members this behavior wants to add. More...
 
short int m_iNewTreeFloats
 The number of new tree float data members this behavior wants to add. More...
 
short int m_iNewTreeChars
 The number of new tree character data members this behavior wants to add. More...
 
short int m_iNewTreeBools
 The number of new tree boolean data members this behavior wants to add. More...
 
short int m_iBehaviorListNumber
 The number of this behavior in the behavior list, to differentiate between possible multiple copies of this behavior. More...
 
float m_fVersionNumber
 Version number - this will be rounded to 2 digits after the decimal place. More...
 
std::string m_sXMLRoot
 XML root that encloses the parameters for this behavior. More...
 
float m_fMinimumVersionNumber
 Minimum version number - this behavior will run parameter data for a file marked between this number and the current version number, inclusive. More...
 
- Protected Attributes inherited from clWorkerBase
std::string m_sNameString
 If a behavior has registered a command line command with the sim manager, this allows it to be called. More...
 
clSimManagermp_oSimManager
 Pointer to the simulation manager object. More...
 
int * mp_iAllowedFileTypes
 List of the input file types this object can handle. More...
 
int m_iNumAllowedTypes
 Number of input file types this object can handle. More...
 

Detailed Description

Substrate Dependent Seed Survival - Version 1.1.

This behavior assesses seed survival as a function of substrate composition. This behavior can be used in three different configurations: with gap status, without gap status, and with microtopography.

This uses the information in the "Substrate" grid (created and populated by clSubstrate) to determine how favorable a location is for seed survival. The "Substrate" grid contains, in each cell, the proportion of each of the six substrate types. For each species, this behavior knows, on a scale from 0 to 1, how favorable a substrate type is to seeds of that species. The behavior calculates a "favorability index" for each grid cell for each species by multiplying the proportion of each substrate by its favorability and summing the results. This index is the proportion of seeds of that species that survive at that location.

If this is used with gap status, then there are two possible favorabilities for each species for each substrate type: the favorability in a gap cell and the favorability in a canopy cell. This behavior uses the appropriate favorabilities for the gap status of the cell.

If this is used with microtopography, then there are twelve substrate types: each of the basic six on the ground and on a mound. Each substrate type is split into mound and ground based on the fixed proportion of each specified by the user. A favorability index is created from these twelve types the same way it is created with six, above.

To keep track of seed favorabilities, this behavior creates a grid called "Substrate Favorability".

In order to translate between different grid cell sizes in the "Substrate" and "Dispersed Seeds" grids, each seed is assigned a temporary random location within its "Dispersed Seeds" grid cell. A random number is compared to the favorability at that location and the seed either survives or dies. The number of surviving seeds in a "Dispersed Seeds" grid cell is assigned back to that cell.

A fatal error is thrown if: there are no disperse behaviors for the run, if gap status establishment is used without gap status disperse, or if substrate establishment is used without substrate.

The namestring for this class is "Substrate Dependent Seed Survival". Call this from the parameter file using either "NoGapSubstrateSeedSurvival", "GapSubstrateSeedSurvival", or "MicrotopographicSubstrateSeedSurvival". Apply this behavior to species; use any type, since it will be ignored.

Copyright 2011 Charles D. Canham.

Author
Lora E. Murphy


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

Constructor & Destructor Documentation

◆ clSubstrateDepSeedSurvival()

clSubstrateDepSeedSurvival::clSubstrateDepSeedSurvival ( clSimManager p_oSimManager)

Constructor.

Parameters
p_oSimManagerSim Manager object.

◆ ~clSubstrateDepSeedSurvival()

clSubstrateDepSeedSurvival::~clSubstrateDepSeedSurvival ( )

Destructor.

Member Function Documentation

◆ Action()

void clSubstrateDepSeedSurvival::Action ( )
virtual

Assesses seed survival.

This calculates the favorability index for each grid cell. For each grid cell, the favorability index is the sum of the proportions of each substrate multiplied by the favorability of that substrate for the cover condition of that grid cell (canopy or gap).

Then, for each cell in the seeds grid, each seed's probability of survival is assessed. It will be given a random location within the grid cell of the "Dispersed Seeds" grid from which it comes. Then a random number is compared to the substrate favorability at that location to see if the seed survives or not. This allows us to translate easily between different grid cell resolutions in the "Dispersed Seeds" and "Substrate" grids.

Reimplemented from clBehaviorBase.

◆ CalculateSubstrateFavorabilityIndex()

void clSubstrateDepSeedSurvival::CalculateSubstrateFavorabilityIndex ( )
protected

For each grid cell in the substrate favorability grid, determines its substrate favorability index.

If m_bUsesGap is true, then the gap status is retrieved from the seed grid and the favorability matches the gap status; otherwise, the favorability is calculated with the canopy parameters.

For each grid cell, the favorability index is the sum of the proportions of each substrate multiplied by the favorability of that substrate for the cover condition of that grid cell (canopy or gap).

◆ GetData()

void clSubstrateDepSeedSurvival::GetData ( xercesc::DOMDocument *  p_oDoc)
virtual

Performs setup.

This calls GetParameterFileData() and SetupGrids().

Parameters
p_oDocDOM tree of parsed input file.

Implements clWorkerBase.

◆ GetParameterFileData()

void clSubstrateDepSeedSurvival::GetParameterFileData ( xercesc::DOMDocument *  p_oDoc)
protected

Declares arrays and fills them with parameter file data.

If m_bUsesGap is true, all gap substrate favorabilities are also retrieved.

Parameters
p_oDocParsed parameter file.
Exceptions
modelErrif any of the substrate favorabilities are not between 0 and 1, or if the mound proportion is not between 0 and 1.

◆ SetNameData()

void clSubstrateDepSeedSurvival::SetNameData ( std::string  sNameString)
virtual

Captures the behavior name passed from the parameter file.

If the name called from the parameter file is "NoGapSubstrateSeedSurvival", then m_bUsesGap is set to false. If the name called is "Gap Substrate Seed Survival", then m_bUsesGap is set to true. If the name called is "MicrotopographicSubstrateSeedSurvival", then m_bUsesGap is set to false and m_bUsesMicro is set to true.

Parameters
sNameStringBehavior name from parameter file.

Reimplemented from clBehaviorBase.

◆ SetupGrids()

void clSubstrateDepSeedSurvival::SetupGrids ( )
protected

Sets up the grids.

This creates the substrate favorability grid and retrieves a pointer to the dispersed seeds grid.

Exceptions
modelErrIf the "Substrate" grid doesn't exist, or if the "Dispersed Seeds" grid doesn't exist.

Member Data Documentation

◆ m_bUsesGap

bool clSubstrateDepSeedSurvival::m_bUsesGap
protected

Whether or not gap status is used by this behavior.

◆ m_bUsesMicro

bool clSubstrateDepSeedSurvival::m_bUsesMicro
protected

Whether or not microtopography is used.

◆ m_fMoundProp

double clSubstrateDepSeedSurvival::m_fMoundProp
protected

Proportion of plot that is mound, if using microtopography - 0 - 1.

◆ m_iDecayedLogCode

short int clSubstrateDepSeedSurvival::m_iDecayedLogCode
protected

Data member code - float - declog grid data member.

◆ m_iForestFloorLitterCode

short int clSubstrateDepSeedSurvival::m_iForestFloorLitterCode
protected

Data member code - float - fflitter grid data member.

◆ m_iForestFloorMossCode

short int clSubstrateDepSeedSurvival::m_iForestFloorMossCode
protected

Data member code - float - ffmoss grid data member.

◆ m_iFreshLogCode

short int clSubstrateDepSeedSurvival::m_iFreshLogCode
protected

Data member code - float - freshlog grid data member.

◆ m_iIsGapCode

short int clSubstrateDepSeedSurvival::m_iIsGapCode
protected

Data member code for gap status in dispersed seed grid.

◆ m_iScarifiedSoilCode

short int clSubstrateDepSeedSurvival::m_iScarifiedSoilCode
protected

Data member code - float - scarsoil grid data member.

◆ m_iTipUpCode

short int clSubstrateDepSeedSurvival::m_iTipUpCode
protected

Data member code - float - tipup grid data member.

◆ mp_fCanGroundDecLogFav

double* clSubstrateDepSeedSurvival::mp_fCanGroundDecLogFav
protected

Canopy / ground decayed logs favorability - one per behavior species.

◆ mp_fCanGroundForFlLitterFav

double* clSubstrateDepSeedSurvival::mp_fCanGroundForFlLitterFav
protected

Canopy / ground forest floor litter favorability - one per behavior species.

◆ mp_fCanGroundForFlMossFav

double* clSubstrateDepSeedSurvival::mp_fCanGroundForFlMossFav
protected

Canopy / ground forest floor moss favorability - one per behavior species.

◆ mp_fCanGroundFreshLogFav

double* clSubstrateDepSeedSurvival::mp_fCanGroundFreshLogFav
protected

Canopy / ground fresh logs favorability - one per behavior species.

◆ mp_fCanGroundScarSoilFav

double* clSubstrateDepSeedSurvival::mp_fCanGroundScarSoilFav
protected

Canopy / ground scarified soil favorability - one per behavior species.

◆ mp_fCanGroundTipUpFav

double* clSubstrateDepSeedSurvival::mp_fCanGroundTipUpFav
protected

Canopy / ground tip-up mounds favorability - one per behavior species.

◆ mp_fGapMoundDecLogFav

double* clSubstrateDepSeedSurvival::mp_fGapMoundDecLogFav
protected

Gap / mound decayed logs favorability - one per behavior species.

◆ mp_fGapMoundForFlLitterFav

double* clSubstrateDepSeedSurvival::mp_fGapMoundForFlLitterFav
protected

Gap / mound forest floor litter favorability - one per behavior species.

◆ mp_fGapMoundForFlMossFav

double* clSubstrateDepSeedSurvival::mp_fGapMoundForFlMossFav
protected

Gap / mound forest floor moss favorability - one per behavior species.

◆ mp_fGapMoundFreshLogFav

double* clSubstrateDepSeedSurvival::mp_fGapMoundFreshLogFav
protected

Gap / mound fresh logs favorability - one per behavior species.

◆ mp_fGapMoundScarSoilFav

double* clSubstrateDepSeedSurvival::mp_fGapMoundScarSoilFav
protected

Gap / mound scarified soil favorability - one per behavior species.

◆ mp_fGapMoundTipUpFav

double* clSubstrateDepSeedSurvival::mp_fGapMoundTipUpFav
protected

Gap / mound tip-up mounds favorability - one per behavior species.

◆ mp_iIndexes

short int* clSubstrateDepSeedSurvival::mp_iIndexes
protected

Speeds access to favorability arrays.

◆ mp_iSeedGridCode

short int* clSubstrateDepSeedSurvival::mp_iSeedGridCode
protected

Data member codes for seed grid for number of seeds.

Array size is # total species.

◆ mp_iSubstrFavCode

short int* clSubstrateDepSeedSurvival::mp_iSubstrFavCode
protected

Data member codes for substrate grid for favorability index.

Array size is # total species.

◆ mp_oSeedGrid

clGrid* clSubstrateDepSeedSurvival::mp_oSeedGrid
protected

Pointer to the "Dispersed Seeds" grid created by disperse behaviors.

◆ mp_oSubstrateFavGrid

clGrid* clSubstrateDepSeedSurvival::mp_oSubstrateFavGrid
protected

The grid called "Substrate Favorability" will have a cell resolution matching the "Substrate" grid.

It will contain the substrate favorability index. The grid cell record will consist of (# species) float data members, "Favorability IndexX". It will have a member for each species even if the creating behavior does not apply to all, because another behavior in this run may apply to different species.

It is possible that a grid map will have been read in for this grid; it will be ignored, and any grid created with such a map will be overwritten.

◆ mp_oSubstrateGrid

clGrid* clSubstrateDepSeedSurvival::mp_oSubstrateGrid
protected

Pointer to "Substrate" grid, created by clSubstrate.


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