SORTIE Core C++ Documentation
|
Models functional response seed predation. More...
#include <FuncResponseSeedPredation.h>
Public Member Functions | |
clFuncResponseSeedPredation (clSimManager *p_oSimManager) | |
Constructor. More... | |
~clFuncResponseSeedPredation () | |
Destructor. More... | |
void | Action () |
Performs the model. More... | |
void | SetNameData (std::string sNameString) |
Captures the behavior name passed from the parameter file. More... | |
float | GetOfftakeRate () |
Get the amount of offtake. 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... | |
clSimManager * | GetSimManager () |
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 | GetData (xercesc::DOMDocument *p_oDoc) |
Reads in the parameter file values. More... | |
void | SetPredatorInitialDensity () |
Sets all grid cells in the predator grid with the appropriate initial density. More... | |
void | GetParameterFileData (xercesc::DOMDocument *p_oDoc) |
Gets the data from the parameter file. More... | |
void | DoModel () |
Does the model for a given value of m_fTempSeeds and m_fTempPredators. 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 | |
clGrid * | mp_oSeedGrid |
Pointer to the "Dispersed Seeds" grid created by disperse behaviors. More... | |
clGrid * | mp_oPredatorGrid |
Pointer to predator grid. More... | |
std::string | m_sOutput |
File to which to write intermediate output, if desired. More... | |
double * | mp_fMaxInstantaneousDeclineRate |
Max instantaneous rate at which predator abundance declines in the absense of food, number of predators per week - array index is 2 (# seasons) More... | |
double * | mp_fDemographicEfficiency |
Population's demographic efficiency - array size is 2 (# seasons) More... | |
double * | mp_fDensityDependentCoefficient |
Density-dependent coefficient - array size is 2 (# seasons) More... | |
double * | mp_fForagingEfficiency |
Foraging efficiency - array size is # behavior species. More... | |
double | m_fPredatorInitialDensity |
Predator initial density - number per square meter. More... | |
double * | mp_fMaxIntakeRate |
Maximum seed intake rate - number of seeds per predator per day - array size is # behavior species. More... | |
double | m_fProportionGerminating |
Proportion of seeds that germinate each week in the germination period - this must be a number between 0 and 1. More... | |
float | m_fCellArea |
Area of a seed grid grid cell in square meters - when multiplied by the density of predators, produces the number in the cell. More... | |
float | m_fOfftake |
Offtake rate - proportion of total seeds eaten, between 0 and 1. More... | |
float * | mp_fTempSeeds |
A place to stash the number of seeds, to allow easy collaborative access to this data between functions. More... | |
float | m_fTempPredators |
A place to stash the number of predators, to allow easy collaborative access to this data between functions. More... | |
int | m_iNumWeeksToModel |
Number of weeks to run the model. More... | |
int | m_iNumWeeksSeedFall |
Number of weeks of seed fall. More... | |
int | m_iWeekGerminationStarts |
Week in which germination begins. More... | |
int | m_iWeekSeason2Starts |
Week in which season 2 begins. More... | |
short int * | mp_iSeedGridCode |
Data member codes for seed grid for number of seeds. More... | |
short int | m_iNumPredsCode |
Data member in the predators grid. More... | |
bool | m_bPreservePredatorDensities |
Whether or not to carry over mouse population densities. More... | |
bool | m_bIsLinked |
Whether this is the linked (true) or standalone (false) version. 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... | |
stcSpeciesTypeCombo * | mp_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... | |
clSimManager * | mp_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... | |
Models functional response seed predation.
This runs as a model-within-a-model, in weekly timesteps for a year. It doesn't matter if the length of the overall model timestep is longer than a year; the amount of seeds is treated as a one-year pool, which produces the same result.
This behavior reduces the number of seeds available in the "Dispersed Seeds" grid. In each cell of that grid, there are a certain number of predators (calculated from the initial density of predators) which have the number of seeds present in that cell as a food source. Each species to which this behavior is applied has its own parameters controlling how it is predated.
Seed rain is evenly divided over a set number of timesteps (weeks). The predator population has as a food source the number of seeds added during the current week's rain (if the rain is going on) plus any leftover seeds from previous weeks which have not been consumed. Beginning at a certain week in the spring, the number of seeds available to the mice is further reduced by a certain percentage each week to simulate germination. Once germination begins, it continues until the predator model finishes running. In order to correctly calculate mouse consumption and ensure that the seeds which germinate are actually available later, this keeps track of the seeds consumed; it is this number which is subtracted from total seeds at the end.
The predator population is updated each timestep as a response to number of seeds consumed. The response parameters can be divided into two seasons.
Seed offtake for each week is calculated as
Per capita seed offtake for each species is
where
The number of predators in each cell's population is calculated as
where
The instantaneous rate of change, r, can use different parameters for two user-defined seasons. r is calculated as
where
This behavior must be used in conjunction with a disperse behavior. If such a behavior is not present (and thus the "Dispersed Seeds" grid is not present), a fatal error will be thrown during setup.
This behavior can be used as an independent behavior where seeds are removed, or it can be linked to another behavior (i.e. the neighborhood seed predation behavior, clNeighborhoodSeedPredation) and used to calculate a whole-plot offtake amount without actually removing any seeds. It's possible to use both in a single run so separate parameters are used for each.
The namestring and parameter file call string are "FunctionalResponseSeedPredation" when used alone, or "LinkedFunctionalResponseSeedPredation" when linked with another behavior.
Copyright 2011 Charles D. Canham.
Edit history:
--------------—
October 20, 2011 - Wiped the slate clean for SORTIE 7.0 (LEM)
clFuncResponseSeedPredation::clFuncResponseSeedPredation | ( | clSimManager * | p_oSimManager | ) |
Constructor.
p_oSimManager | Sim Manager object. |
clFuncResponseSeedPredation::~clFuncResponseSeedPredation | ( | ) |
Destructor.
Frees memory.
|
virtual |
Performs the model.
If predator densities are not to be preserved, then the predator grid is initialized with SetPredatorInitialDensity().
Reimplemented from clBehaviorBase.
|
protected |
Does the model for a given value of m_fTempSeeds and m_fTempPredators.
|
protectedvirtual |
Reads in the parameter file values.
p_oDoc | DOM tree of parsed input file. |
modelErr | if there is no such grid called "Dispersed Seeds", or if the "Dispersed Seeds" grid does not contain a valid return code for all behavior species. |
Implements clWorkerBase.
|
inline |
Get the amount of offtake.
|
protected |
Gets the data from the parameter file.
p_oDoc | DOM tree of parsed input file. |
modelErr | if:
|
|
virtual |
Captures the behavior name passed from the parameter file.
This is useful since this class can produce different kinds of behaviors.
sNameString | Behavior name from parameter file. |
Reimplemented from clBehaviorBase.
|
protected |
Sets all grid cells in the predator grid with the appropriate initial density.
|
protected |
Whether this is the linked (true) or standalone (false) version.
|
protected |
Whether or not to carry over mouse population densities.
|
protected |
Area of a seed grid grid cell in square meters - when multiplied by the density of predators, produces the number in the cell.
|
protected |
Offtake rate - proportion of total seeds eaten, between 0 and 1.
Used if this is linked.
|
protected |
Predator initial density - number per square meter.
|
protected |
Proportion of seeds that germinate each week in the germination period - this must be a number between 0 and 1.
|
protected |
A place to stash the number of predators, to allow easy collaborative access to this data between functions.
|
protected |
Data member in the predators grid.
|
protected |
Number of weeks of seed fall.
|
protected |
Number of weeks to run the model.
|
protected |
Week in which germination begins.
|
protected |
Week in which season 2 begins.
|
protected |
File to which to write intermediate output, if desired.
|
protected |
Population's demographic efficiency - array size is 2 (# seasons)
|
protected |
Density-dependent coefficient - array size is 2 (# seasons)
|
protected |
Foraging efficiency - array size is # behavior species.
|
protected |
Max instantaneous rate at which predator abundance declines in the absense of food, number of predators per week - array index is 2 (# seasons)
|
protected |
Maximum seed intake rate - number of seeds per predator per day - array size is # behavior species.
|
protected |
A place to stash the number of seeds, to allow easy collaborative access to this data between functions.
Array size is # behavior species.
|
protected |
Data member codes for seed grid for number of seeds.
Array size is # behavior species.
|
protected |
Pointer to predator grid.
The name of this grid is "Seed Predators". Its grid cell resolution will match that of "Dispersed Seeds". It has one float data member - "num preds". It will accept maps if m_bPreservePredatorDensities = true and if they are of the right resolution.
|
protected |
Pointer to the "Dispersed Seeds" grid created by disperse behaviors.