#include <MicroEstablishment.h>
Inheritance diagram for clMicroEstablishment:
Public Member Functions | |
clMicroEstablishment (clSimManager *p_oSimManager) | |
Constructor. | |
~clMicroEstablishment () | |
Destructor. | |
void | GetData (xercesc::DOMDocument *p_oDoc) |
Performs setup. | |
void | Action () |
Performs establishment. | |
Protected Types | |
enum | substrateType { mound_scarsoil, mound_tipup, mound_freshlogs, mound_decayedlogs, mound_fflitter, mound_ffmoss, ground_scarsoil, ground_tipup, ground_freshlogs, ground_decayedlogs, ground_fflitter, ground_ffmoss, number_substrates } |
List of substrate types - be extremely careful when changing these! More... | |
Protected Member Functions | |
void | GetParameterFileData (xercesc::DOMDocument *p_oDoc) |
Gets parameter file data. | |
void | SetupGrids () |
Populates required grid pointers. | |
void | GetTreeDataMemberCodes () |
Declares and populates the values in the mp_iCounterCodes and mp_iZCodes arrays, for the "lf_count" and "z" data members of seedlings, respectively. | |
void | GetSubstrateProportions (float *p_fSubstrate, const float &fFromX, const float &fFromY, const float &fToX, const float &fToY) |
Produces an array of substrate proportions. | |
void | GetFreshLogProportions (float *p_fLogs, const float &fFromX, const float &fFromY, const float &fToX, const float &fToY) |
Produces an array of cumulative fresh log proportions added for m_iMaxRespiteTimesteps timesteps. | |
void | SetFreshLogZAndRespite (clTree *p_oSeedling, float *p_fFreshLogProportions) |
Sets the rooting height of a tree in mm and a fern respite counter in years, if a seedling has landed on fresh logs. | |
void | SetMoundZAndRespite (clTree *p_oSeedling) |
Sets the rooting height of a seedling in mm if it has landed on a mound substrate that is not fresh logs. | |
void | SetGroundZAndRespite (clTree *p_oSeedling) |
Sets the rooting height of a seedling in mm if it has landed on a ground substrate that is not fresh logs. | |
Protected Attributes | |
clGridBase * | mp_oSubstrateGrid |
Pointer to "Substrate" grid, created by clSubstrate. | |
clGridBase * | mp_oSeedGrid |
Pointer to the "Dispersed Seeds" grid created by disperse behaviors. | |
short int * | mp_iSeedGridCode |
Data member codes for seed grid for number of seeds. | |
short int * | mp_iCounterCodes |
Holds data member codes for "lf_count" for seedlings - array size is # behavior species. | |
short int * | mp_iZCodes |
Holds data member codes for "z" for seedlings - array size is # behavior species. | |
short int * | mp_iIndexes |
Speeds access to arrays. | |
short int * | mp_iSubstrateCodes |
Array of data member codes for the "Substrate" grid. | |
float | m_fMoundProportion |
Proportion of the plot that is mound. | |
float | m_fMoundHeightMean |
Mean mound height. | |
float | m_fMoundStandardDeviation |
Mound height standard deviation. | |
float | m_fFreshLogHeightMean |
Fresh log substrate mean height. | |
float | m_fFreshLogStandardDeviation |
Fresh log height standard deviation. | |
float | m_fFreshLogA |
Fresh log alpha decay parameter; from substrate parameters. | |
float | m_fFreshLogB |
Fresh log alpha decay parameter; from substrate parameters. | |
int | m_iMaxRespiteYears |
Maximum number of years of fern respite - from parameter file. | |
int | m_iMaxRespiteTimesteps |
Maximum number of timesteps of fern respite - calculated from m_iMaxRespiteYears. | |
short int | m_iCohFreshLogCode |
Data member code - package float - dec_flog. | |
short int | m_iCohAgeCode |
Data member code - package int - age. | |
Friends | |
class | clTestMicroEstablishment |
My unit tester - exists in the testing application. |
This behavior germinates seeds cast by dispersal into seedlings. In addition, seeds are given a height above the ground due to microtopography.
All seeds are germinated into seedlings. A seed's substrate determines its rooting height. In order to seeds to substrates, the number of seeds is evenly divided as much as possible among the different substrate types. The clSubstrate class divides each grid cell of the "Substrate" grid into six substrate types; this further divides each substrate type in two, for mound and ground. Mound and ground are in fixed relative proportion to each other.
The definition of seedling rooting height comes from the clLightFilter class. Since this class makes no sense without that, that behavior is required to be in the run (as marked by the presence of the tree data members "lf_count" and "z").
Ground substrates (except fresh log) give a seed a rooting height of 0. Fresh log and mound substrates give rooting heights that are randomly drawn on normal distributions, the shape of which are controlled by means and standard deviations provided by the user.
If the seed lands on a log substrate, it also gets a respite from fern shading. The number of years of respite is set in the "lf_count" data member. The number of years is determined by the age of the log substrate on which the seedling landed (which is determined by dividing the fresh logs pool up by age and doing a random draw to determine which it is), and that age is subtracted from the maximum respite time.
Requirements for using an object of this class in a run:
The namestring and parameter file call string for this class are both "Micro Establishment". Apply this behavior to the desired species; use any type, since type will be ignored.
Copyright 2003 Charles D. Canham.
|
|
Constructor.
|
|
Performs establishment. Steps for each grid cell in Dispersed Seeds:
Reimplemented from clBehaviorBase. |
|
Performs setup. Calls:
Implements clWorkerBase. |
|
Produces an array of cumulative fresh log proportions added for m_iMaxRespiteTimesteps timesteps. First, the amount of fresh log substrate for each timestep is placed in the appropriate array bucket. This value comes from substrate cohort packages. We have to decay the amount of fresh log by the age of the cohort; here's how: Then the values are converted to proportion of total fresh log by dividing each array bucket by the total in all buckets. Then, to each array value, the total value of all previous buckets is added so that the fresh log proportions are cumulative. Note:This also used to collect fresh log mean DBHs. This has been commented out as not currently needed. Areas are averaged over grid cells if seed grid cell sizes are bigger than substrate grid cell sizes.
|
|
Gets parameter file data.
|
|
Produces an array of substrate proportions. First, the amount of substrate for each substrate type is placed in the appropriate array bucket. Then mound substrates are multiplied by the proportion of the total area that is mound; ground substrates are multipled by 1 - that proportion. Areas are averaged over grid cells if seed grid cell sizes are bigger than substrate grid cell sizes.
|
|
Declares and populates the values in the mp_iCounterCodes and mp_iZCodes arrays, for the "lf_count" and "z" data members of seedlings, respectively.
|
|
Sets the rooting height of a tree in mm and a fern respite counter in years, if a seedling has landed on fresh logs. A random number is compared to successive values in p_fFreshLogProportions until an array value is greater than the random value. That bucket represents the age of the fresh logs, in timesteps, onto which the seed has landed. The respite counter is m_iMaxRespite minus the age of the fresh log cohort in years. The rooting height is a normally-distributed random number using the fresh log mean height and standard deviation from the parameter file. (Fresh logs overlie and obliterate the effects of mounds.)
|
|
Sets the rooting height of a seedling in mm if it has landed on a ground substrate that is not fresh logs. The rooting height and fern respite counters are always 0.
|
|
Sets the rooting height of a seedling in mm if it has landed on a mound substrate that is not fresh logs. The rooting height is a random normally-distributed value using the mound mean height (in m_fMoundHeightMean) and mound standard deviation (in m_fMoundStandardDeviation). In this non-fresh-log case, the fern respite counter is always 0.
|
|
Populates required grid pointers. This gets a pointer to the "Substrate" grid and all its data members, and gets a pointer to the "Dispersed Seeds" grid and all its data members.
|
|
My unit tester - exists in the testing application. I didn't want to have to do this but I couldn't figure out a way to effectively unit test any other way. |
|
Fresh log alpha decay parameter; from substrate parameters. This lets this class calculate fresh log ages. |
|
Fresh log alpha decay parameter; from substrate parameters. This lets this class calculate fresh log ages. |
|
Fresh log substrate mean height. Read in in meters, then converted to mm |
|
Fresh log height standard deviation. Read in in meters, then converted to mm |
|
Mean mound height. Read in in meters, then converted to mm |
|
Mound height standard deviation. Read in in meters, then converted to mm |
|
Data member codes for seed grid for number of seeds. Array size is # behavior species. |
|
Array of data member codes for the "Substrate" grid. It's sized number_substrates; repeat substrates get the same code (i.e. mound and ground fresh logs |