#include <FuncResponseSeedPredation.h>
Public Member Functions | |
clFuncResponseSeedPredation (clSimManager *p_oSimManager) | |
Constructor. | |
~clFuncResponseSeedPredation () | |
Destructor. | |
void | Action () |
Performs the model. | |
void | SetNameData (char *cNameString) |
Captures the behavior name passed from the parameter file. | |
float | GetOfftakeRate () |
Get the amount of offtake. | |
Protected Member Functions | |
void | GetData (xercesc::DOMDocument *p_oDoc) |
Reads in the parameter file values. | |
void | SetPredatorInitialDensity () |
Sets all grid cells in the predator grid with the appropriate initial density. | |
void | GetParameterFileData (xercesc::DOMDocument *p_oDoc) |
Gets the data from the parameter file. | |
void | DoModel () |
Does the model for a given value of m_fTempSeeds and m_fTempPredators. | |
Protected Attributes | |
clGridBase * | mp_oSeedGrid |
Pointer to the "Dispersed Seeds" grid created by disperse behaviors. | |
clGridBase * | mp_oPredatorGrid |
Pointer to predator grid. | |
char | m_cOutput [MAX_FILENAME_SIZE] |
File to which to write intermediate output, if desired. | |
float * | 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). | |
float * | mp_fDemographicEfficiency |
Population's demographic efficiency - array size is 2 (# seasons). | |
float * | mp_fDensityDependentCoefficient |
Density-dependent coefficient - array size is 2 (# seasons). | |
float * | mp_fForagingEfficiency |
Foraging efficiency - array size is # behavior species. | |
float | m_fPredatorInitialDensity |
Predator initial density - number per square meter. | |
float * | mp_fMaxIntakeRate |
Maximum seed intake rate - number of seeds per predator per day - array size is # behavior species. | |
float | m_fProportionGerminating |
Proportion of seeds that germinate each week in the germination period - this must be a number between 0 and 1. | |
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. | |
float | m_fOfftake |
Offtake rate - proportion of total seeds eaten, between 0 and 1. | |
float * | mp_fTempSeeds |
A place to stash the number of seeds, to allow easy collaborative access to this data between functions. | |
float | m_fTempPredators |
A place to stash the number of predators, to allow easy collaborative access to this data between functions. | |
int | m_iNumWeeksToModel |
Number of weeks to run the model. | |
int | m_iNumWeeksSeedFall |
Number of weeks of seed fall. | |
int | m_iWeekGerminationStarts |
Week in which germination begins. | |
int | m_iWeekSeason2Starts |
Week in which season 2 begins. | |
short int * | mp_iSeedGridCode |
Data member codes for seed grid for number of seeds. | |
short int | m_iNumPredsCode |
Data member in the predators grid. | |
bool | m_bPreservePredatorDensities |
Whether or not to carry over mouse population densities. | |
bool | m_bIsLinked |
Whether this is the linked (true) or standalone (false) version. |
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
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 "functional response seed predation" when used alone, or "linked functional response seed predation" when linked with another behavior.
Copyright 2004 Charles D. Canham.
clFuncResponseSeedPredation::clFuncResponseSeedPredation | ( | clSimManager * | p_oSimManager | ) |
Constructor.
p_oSimManager | Sim Manager object. |
clFuncResponseSeedPredation::~clFuncResponseSeedPredation | ( | ) |
Destructor.
Frees memory.
void clFuncResponseSeedPredation::Action | ( | ) | [virtual] |
Performs the model.
If predator densities are not to be preserved, then the predator grid is initialized with SetPredatorInitialDensity().
Reimplemented from clBehaviorBase.
void clFuncResponseSeedPredation::SetNameData | ( | char * | cNameString | ) | [virtual] |
Captures the behavior name passed from the parameter file.
This is useful since this class can produce different kinds of behaviors.
cNameString | Behavior name from parameter file. |
Reimplemented from clBehaviorBase.
float clFuncResponseSeedPredation::GetOfftakeRate | ( | ) | [inline] |
Get the amount of offtake.
void clFuncResponseSeedPredation::GetData | ( | xercesc::DOMDocument * | p_oDoc | ) | [protected, virtual] |
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.
void clFuncResponseSeedPredation::SetPredatorInitialDensity | ( | ) | [protected] |
Sets all grid cells in the predator grid with the appropriate initial density.
void clFuncResponseSeedPredation::GetParameterFileData | ( | xercesc::DOMDocument * | p_oDoc | ) | [protected] |
Gets the data from the parameter file.
p_oDoc | DOM tree of parsed input file. |
modelErr | if:
|
void clFuncResponseSeedPredation::DoModel | ( | ) | [protected] |
Does the model for a given value of m_fTempSeeds and m_fTempPredators.
clGridBase* clFuncResponseSeedPredation::mp_oSeedGrid [protected] |
Pointer to the "Dispersed Seeds" grid created by disperse behaviors.
clGridBase* clFuncResponseSeedPredation::mp_oPredatorGrid [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.
char clFuncResponseSeedPredation::m_cOutput[MAX_FILENAME_SIZE] [protected] |
File to which to write intermediate output, if desired.
float* clFuncResponseSeedPredation::mp_fMaxInstantaneousDeclineRate [protected] |
Max instantaneous rate at which predator abundance declines in the absense of food, number of predators per week - array index is 2 (# seasons).
float* clFuncResponseSeedPredation::mp_fDemographicEfficiency [protected] |
Population's demographic efficiency - array size is 2 (# seasons).
float* clFuncResponseSeedPredation::mp_fDensityDependentCoefficient [protected] |
Density-dependent coefficient - array size is 2 (# seasons).
float* clFuncResponseSeedPredation::mp_fForagingEfficiency [protected] |
Foraging efficiency - array size is # behavior species.
float clFuncResponseSeedPredation::m_fPredatorInitialDensity [protected] |
Predator initial density - number per square meter.
float* clFuncResponseSeedPredation::mp_fMaxIntakeRate [protected] |
Maximum seed intake rate - number of seeds per predator per day - array size is # behavior species.
float clFuncResponseSeedPredation::m_fProportionGerminating [protected] |
Proportion of seeds that germinate each week in the germination period - this must be a number between 0 and 1.
float clFuncResponseSeedPredation::m_fCellArea [protected] |
Area of a seed grid grid cell in square meters - when multiplied by the density of predators, produces the number in the cell.
float clFuncResponseSeedPredation::m_fOfftake [protected] |
Offtake rate - proportion of total seeds eaten, between 0 and 1.
Used if this is linked.
float* clFuncResponseSeedPredation::mp_fTempSeeds [protected] |
A place to stash the number of seeds, to allow easy collaborative access to this data between functions.
Array size is # behavior species.
float clFuncResponseSeedPredation::m_fTempPredators [protected] |
A place to stash the number of predators, to allow easy collaborative access to this data between functions.
int clFuncResponseSeedPredation::m_iNumWeeksToModel [protected] |
Number of weeks to run the model.
int clFuncResponseSeedPredation::m_iNumWeeksSeedFall [protected] |
Number of weeks of seed fall.
int clFuncResponseSeedPredation::m_iWeekGerminationStarts [protected] |
Week in which germination begins.
int clFuncResponseSeedPredation::m_iWeekSeason2Starts [protected] |
Week in which season 2 begins.
short int* clFuncResponseSeedPredation::mp_iSeedGridCode [protected] |
Data member codes for seed grid for number of seeds.
Array size is # behavior species.
short int clFuncResponseSeedPredation::m_iNumPredsCode [protected] |
Data member in the predators grid.
bool clFuncResponseSeedPredation::m_bPreservePredatorDensities [protected] |
Whether or not to carry over mouse population densities.
bool clFuncResponseSeedPredation::m_bIsLinked [protected] |
Whether this is the linked (true) or standalone (false) version.