#include <GridBasedSpatialDisperse.h>
Inheritance diagram for clGridBasedSpatialDisperse:
Public Member Functions | |
clGridBasedSpatialDisperse (clSimManager *p_oSimManager) | |
Constructor. | |
~clGridBasedSpatialDisperse () | |
Destructor. | |
Protected Member Functions | |
void | AddSeeds () |
Performs dispersal. | |
virtual void | DoChildSetup (xercesc::DOMDocument *p_oDoc) |
Child classes can override this to do extra setup. | |
void | DoShellSetup (xercesc::DOMDocument *p_oDoc) |
Reads in values from the parameter file. | |
virtual float | GetFunctionValue (float &fCellX, float &fCellY, float &fTreeX, float &fTreeY, int &iSpecies)=0 |
Gets normalized function value which, when multiplied by fecundity, gets the number of seeds for a tree. | |
void | DeclareArrays () |
Declares the arrays. | |
void | GetParameterFileData (xercesc::DOMDocument *p_oDoc) |
Extracts needed parameter file data. | |
void | CalculateFecundity () |
Calculates fecundity. | |
void | PopulateUsedTable () |
Declares and populates the mp_bIsUsed array. | |
void | CalculateQueryHeight () |
Calculates the shortest possible reproducing neighbor, by finding the shortest height at a species' min. | |
Protected Attributes | |
clPlot * | mp_oPlot |
Plot object. | |
float * | mp_fDispersalX0 |
Dispersal (weibull) or X0 (lognormal) parameter for each species. | |
float * | mp_fThetaXb |
Theta (weibull) or Xb (lognormal) parameter for each species. | |
float * | mp_fStr |
Seedling Total Recruits for each species. | |
float * | mp_fBeta |
Beta parameter for each species. | |
float * | mp_fFecundity |
Fecundity for 30 cm dbh tree for each species. | |
float | m_fMaxSearchRadius |
Max distance in m to search for dispersing parents from the center of a grid cell. | |
float | m_fQueryHeight |
Shortest possible reproducing neighbor height, for putting in distance/height queries. | |
float | m_fSeedCellArea |
Area of seed grid cell in square meters. | |
float | m_fNumYearsPerTimestep |
Number of years per timestep. | |
short int * | mp_iIndexes |
This will speed access to the other arrays by storing each species' array index so the other arrays only have to be as big as the number of unique species for this behavior. | |
short int | m_iNumFunctions |
How many functions there are - 2. | |
short int * | mp_iWhatFunction |
Which function is used for each species. | |
bool ** | mp_bIsUsed |
Whether this behavior is used by a species/type combo. |
This is a base class for behaviors that create and disperse seeds according to the spatially-explicit model. For each grid cell, the number of seeds is calculated based on the size and distance of parents of that species.
This class and its descendents do not take gap status into account. Behaviors of this class cannot be applied to stumps.
The "seeds" are actually tallies by species in a grid. This behavior does not produce any seedlings. A separate recruitment behavior must "germinate" the seeds into seedlings according to its own rules.
Copyright 2003 Charles D. Canham.
clGridBasedSpatialDisperse::clGridBasedSpatialDisperse | ( | clSimManager * | p_oSimManager | ) |
Constructor.
p_oSimManager | Sim Manager object. |
void clGridBasedSpatialDisperse::AddSeeds | ( | ) | [protected, virtual] |
Performs dispersal.
For each grid cell, the center point of the cell is calculated. For each species to which this behavior applies, a search is done to find all trees within the maximum search radius. For each tree, the number of seeds to add is gotten by multiplying the fecundity by the return value of the virtual function GetFunctionValue(). The total number of seeds for a species is RandomRound()ed to arrive at an integer.
Implements clDisperseBase.
void clGridBasedSpatialDisperse::CalculateFecundity | ( | ) | [protected] |
Calculates fecundity.
Fecundity is calculated as
void clGridBasedSpatialDisperse::CalculateQueryHeight | ( | ) | [protected] |
Calculates the shortest possible reproducing neighbor, by finding the shortest height at a species' min.
reproductive DBH.
virtual void clGridBasedSpatialDisperse::DoChildSetup | ( | xercesc::DOMDocument * | p_oDoc | ) | [inline, protected, virtual] |
Child classes can override this to do extra setup.
p_oDoc | Pointer to parsed parameter file. |
Reimplemented in clAnisotropicDisperse, and clIsotropicDisperse.
void clGridBasedSpatialDisperse::DoShellSetup | ( | xercesc::DOMDocument * | p_oDoc | ) | [protected, virtual] |
Reads in values from the parameter file.
p_oDoc | DOM tree of parsed input file. |
Implements clDisperseBase.
virtual float clGridBasedSpatialDisperse::GetFunctionValue | ( | float & | fCellX, | |
float & | fCellY, | |||
float & | fTreeX, | |||
float & | fTreeY, | |||
int & | iSpecies | |||
) | [protected, pure virtual] |
Gets normalized function value which, when multiplied by fecundity, gets the number of seeds for a tree.
Must be overridden by child classes.
fCellX | X coordinate of point at center of grid cell into which seeds are being dispersed. | |
fCellY | Y coordinate of point at center of grid cell into which seeds are being dispersed. | |
fTreeX | X coordinate of neighbor parent tree. | |
fTreeY | Y coordinate of neighbor parent tree. | |
iSpecies | Species of neighbor parent tree. |
Implemented in clAnisotropicDisperse, and clIsotropicDisperse.
void clGridBasedSpatialDisperse::GetParameterFileData | ( | xercesc::DOMDocument * | p_oDoc | ) | [protected] |
Extracts needed parameter file data.
This function takes into account whether this is isotropic or anisotropic.
p_oDoc | Parsed parameter file document. |
modelErr | if the function values are not valid, or if the max search radius is negative or greater than half the shortest plot length. |
void clGridBasedSpatialDisperse::PopulateUsedTable | ( | ) | [protected] |
Declares and populates the mp_bIsUsed array.
modelErr | if the object is being applied to a type other than sapling and adult. |
float clGridBasedSpatialDisperse::m_fMaxSearchRadius [protected] |
Max distance in m to search for dispersing parents from the center of a grid cell.
This must be less than half the shortest plot distance.
bool** clGridBasedSpatialDisperse::mp_bIsUsed [protected] |
Whether this behavior is used by a species/type combo.
First array index is species, second is type. This helps quickly sort through the results of neighbor searches.
float* clGridBasedSpatialDisperse::mp_fBeta [protected] |
Beta parameter for each species.
This value comes from the parameter file.
float* clGridBasedSpatialDisperse::mp_fDispersalX0 [protected] |
Dispersal (weibull) or X0 (lognormal) parameter for each species.
This value comes from the parameter file.
float* clGridBasedSpatialDisperse::mp_fFecundity [protected] |
Fecundity for 30 cm dbh tree for each species.
This value is calculated in CalculateFecundity().
float* clGridBasedSpatialDisperse::mp_fStr [protected] |
Seedling Total Recruits for each species.
This value comes from the parameter file.
float* clGridBasedSpatialDisperse::mp_fThetaXb [protected] |
Theta (weibull) or Xb (lognormal) parameter for each species.
This value comes from the parameter file.