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

Masting non-spatial disperse - Version 1.0. More...

#include <MastingNonSpatialDisperse.h>

Inheritance diagram for clMastingNonSpatialDisperse:
clDisperseBase clBehaviorBase clWorkerBase

Public Member Functions

 clMastingNonSpatialDisperse (clSimManager *p_oSimManager)
 Constructor. More...
 
 ~clMastingNonSpatialDisperse ()
 Destructor. More...
 
mastEvent GetMastEvent (int iSp)
 Get whether a given species masted this timestep. More...
 
- Public Member Functions inherited from clDisperseBase
 clDisperseBase (clSimManager *p_oSimManager)
 Constructor. More...
 
virtual ~clDisperseBase ()
 Destroys common objects. More...
 
void Action ()
 Performs all disperse calculations. More...
 
void TimestepCleanup ()
 Resets all values in the seed grid to 0 and sets the static m_bUpdatedGapStatus to false if this is a hooked object. 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 void SetNameData (std::string sNameString)
 Sets the string for the parameter file 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 EndOfRunCleanup ()
 Performs any necessary cleanup operations at the end of a run. More...
 

Protected Member Functions

void DoShellSetup (xercesc::DOMDocument *p_oDoc)
 Reads in parameter file values. More...
 
void ComputeBasalArea ()
 Computes the total "basal area" of all adults for each species. More...
 
void AddSeeds ()
 Does dispersal. More...
 
- Protected Member Functions inherited from clDisperseBase
void GetData (xercesc::DOMDocument *p_oDoc)
 Triggers all disperse setup if an object is hooked. More...
 
void SetUpBase ()
 Does disperse base setup. 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

double ** mp_fInvGaussMu
 Mu parameter for inverse gaussian distribution. More...
 
double ** mp_fInvGaussLambda
 Lambda parameter for inverse gaussian distribution. More...
 
double ** mp_fNormalMean
 Mean for normal distribution. More...
 
double ** mp_fNormalStandardDev
 Standard deviation for normal distribution. More...
 
double * mp_fBinomialP
 P parameter for binomial distribution for deciding when to mast - array size = number behavior species. More...
 
float * mp_fBasalArea
 "Basal area" for each species. More...
 
short int * mp_iGroup
 Group affiliation of the species. More...
 
enum mastEventmp_iEvent
 Which event is occurring in the current timestep for each species. More...
 
pdf ** mp_iFunction
 PDF to use for seed draw. More...
 
bool m_bGroupsUsed
 Whether or not species are put into groups. More...
 
- Protected Attributes inherited from clDisperseBase
bool m_bHooked
 
- 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...
 

Additional Inherited Members

- Protected Types inherited from clDisperseBase
enum  function { weibull, lognormal }
 What PDF is used by a species. More...
 
enum  cover { gap, canopy }
 Cover status. More...
 
- Static Protected Attributes inherited from clDisperseBase
static clDisperseOrgmp_oDisperseOrg
 clDisperseOrg object - this pointer is held in common by all shells More...
 
static clGridmp_oSeedGrid
 Seed grid. More...
 
static short int * mp_iNumSeedsCode
 Data member codes for "dispersed seeds" grid for "seeds_x" data member. More...
 
static short int m_iGapCountCode
 Data member code - for counting trees for gap status. More...
 
static short int m_iIsGapCode
 Data member code for substrate grid for gap status. More...
 
static short int m_iTotalSpecies
 Total number of species. More...
 
static bool m_bUpdatedGapStatus
 A flag indicating whether or not the gap status of the seed grid has been updated this timestep. More...
 
static bool m_bIsStochastic
 Whether dispersal is stochastic (true) or deterministic (false). More...
 

Detailed Description

Masting non-spatial disperse - Version 1.0.

This class performs non-spatial dispersal with masting. The actual dispersal is non-density dependent, or bath, dispersal. This is a constant seed rain which does not depend on the presence of parent trees in the plot. The actual disperal - just dropping a constant amount of seed everywhere - is easy. Figuring out how much seed to drop is the complicated bit.

The first decision is whether or not there will be masting. This is done by using a random draw on a binomial probability distribution. Each species gets its parameters for this distribution.

Once it is known whether masting will occur, the actual number of seeds per square meter is drawn from a random distribution. Each species can use its own probability function, and can use different functions in masting and non-masting timesteps.

Once the number of seeds per square meter is known, they are evenly distributed to the seed grid cells.

As an additional refinement, species can mast together in groups. In this case, all the species in a group are treated as one entity - masting together, and using the same parameters for seed dispersal - except that at the end, once the number of seeds per square meter is known, they are divided up according to the relative basal areas of the adults in the group across the entire plot. If there are no adults of any of the species in the plot, the seeds are divided evenly.

Apart from grouping, species operate completely independently and the masting activities of one species do not affect the others in any way.

This behavior's namestring and parameter file call string are both "MastingNonSpatialDisperse".

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

◆ clMastingNonSpatialDisperse()

clMastingNonSpatialDisperse::clMastingNonSpatialDisperse ( clSimManager p_oSimManager)

Constructor.

Parameters
p_oSimManagerSim Manager object.

◆ ~clMastingNonSpatialDisperse()

clMastingNonSpatialDisperse::~clMastingNonSpatialDisperse ( )

Destructor.

Member Function Documentation

◆ AddSeeds()

void clMastingNonSpatialDisperse::AddSeeds ( )
protectedvirtual

Does dispersal.

This calculates basal area as necessary for groups; checks to see if masting is occurring or not; then uses the appropriate random draw and the appropriate parameters to pick the number of seeds to add to each grid cell.

Implements clDisperseBase.

◆ ComputeBasalArea()

void clMastingNonSpatialDisperse::ComputeBasalArea ( )
protected

Computes the total "basal area" of all adults for each species.

This will allow calculation of relative basal area for each group. Basal area is not actually basal area, since we don't need to multiply by pi to get the relative values. We'll just square the radii. Totals are placed in mp_fBasalArea.

◆ DoShellSetup()

void clMastingNonSpatialDisperse::DoShellSetup ( xercesc::DOMDocument *  p_oDoc)
protectedvirtual

Reads in parameter file values.

Parameters
p_oDocDOM tree of parsed parameter file.

Implements clDisperseBase.

◆ GetMastEvent()

mastEvent clMastingNonSpatialDisperse::GetMastEvent ( int  iSp)

Get whether a given species masted this timestep.

Parameters
iSpSpecies to check
Returns
mast or nonmast.

Member Data Documentation

◆ m_bGroupsUsed

bool clMastingNonSpatialDisperse::m_bGroupsUsed
protected

Whether or not species are put into groups.

◆ mp_fBasalArea

float* clMastingNonSpatialDisperse::mp_fBasalArea
protected

"Basal area" for each species.

Since all we care about is relative proportion, this will just add up the squares of the radii. Array size = number behavior species.

◆ mp_fBinomialP

double* clMastingNonSpatialDisperse::mp_fBinomialP
protected

P parameter for binomial distribution for deciding when to mast - array size = number behavior species.

◆ mp_fInvGaussLambda

double** clMastingNonSpatialDisperse::mp_fInvGaussLambda
protected

Lambda parameter for inverse gaussian distribution.

The array is 2D - the first index is masting or non-masting. The second index is number behavior species.

◆ mp_fInvGaussMu

double** clMastingNonSpatialDisperse::mp_fInvGaussMu
protected

Mu parameter for inverse gaussian distribution.

The array is 2D - the first index is masting or non-masting. The second index is number behavior species.

◆ mp_fNormalMean

double** clMastingNonSpatialDisperse::mp_fNormalMean
protected

Mean for normal distribution.

The array is 2D - the first index is masting or non-masting. The second index is species.

◆ mp_fNormalStandardDev

double** clMastingNonSpatialDisperse::mp_fNormalStandardDev
protected

Standard deviation for normal distribution.

The array is 2D - the first index is masting or non-masting. The second index is species.

◆ mp_iEvent

enum mastEvent* clMastingNonSpatialDisperse::mp_iEvent
protected

Which event is occurring in the current timestep for each species.

◆ mp_iFunction

pdf** clMastingNonSpatialDisperse::mp_iFunction
protected

PDF to use for seed draw.

The array is 2D - the first index is masting or non-masting. The second index is number behavior species.

◆ mp_iGroup

short int* clMastingNonSpatialDisperse::mp_iGroup
protected

Group affiliation of the species.

Any species with the same group number will always mast together. Array size is number behavior species.


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