clNeighborhoodSeedPredation Class Reference

Neighborhood Seed Predation - version 1.1. More...

#include <NeighborhoodSeedPredation.h>

Inheritance diagram for clNeighborhoodSeedPredation:

clBehaviorBase clWorkerBase

List of all members.

Public Member Functions

 clNeighborhoodSeedPredation (clSimManager *p_oSimManager)
 Constructor.
 ~clNeighborhoodSeedPredation ()
 Destructor.
void Action ()
 Performs neighborhood seed predation.
void SetNameData (char *cNameString)
 Captures the behavior name passed from the parameter file.

Protected Member Functions

void GetData (xercesc::DOMDocument *p_oDoc)
 Does setup.
void DoStandalonePredation ()
 Performs neighborhood seed predation for the standalone version of this behavior.
void DoLinkedPredation ()
 Performs neighborhood seed predation for the linked version of this behavior.
void GetOfftakes (clTreePopulation *p_oPop, const float *p_fP0, float **p_fPn, float *p_fOfftake, const int &iX, const int &iY)
 Gets the offtake (Y) values for all behavior species for a given grid cell.
void SetupGrids ()
 Gets a pointer to the "Dispersed Seeds" grid, and sets up the output grid.
void ReadParameterFileData (xercesc::DOMDocument *p_oDoc)
 Reads parameter file data.

Protected Attributes

clGridBasemp_oSeedGrid
 Pointer to the "Dispersed Seeds" grid created by disperse behaviors.
float * mp_fNonMastingP0
 Non-masting "p0" parameter.
float ** mp_fNonMastingPn
 Non-masting pn.
float * mp_fMastingP0
 Masting "p0" parameter.
float * mp_fMinNeighDBH
 Minimum neighbor DBH.
float ** mp_fMastingPn
 Masting pn.
short int * mp_iSeedGridCode
 Data member codes for seed grid for number of seeds.
short int * mp_iStartSeedsCode
 Data member codes for the "startseeds_x" member of the output grid.
short int * mp_iPropEatenCode
 Data member codes for the "propeaten_x" member of the output grid.
short int * mp_iIndexes
 For accessing the other arrays.
bool * mp_bCountInMast
 Whether or not a species counts when making masting decisions.
float m_fPlotArea
 Area of the plot, in square meters.
float m_fRadius
 Radius of neighborhoods.
float m_fMastingThreshold
 Threshold of seeds per square meter for a masting timestep.
bool m_bIsLinked
 Whether this is the linked (true) or standalone (false) version.
bool m_bUseThresholdToDecideMast
 Whether to use a seed density threshold (true) or ask the masting disperse behaviors (false) when deciding whether this is a masting timestep.

Static Protected Attributes

static clGridBasemp_oOutputGrid
 Grid to output details of seed predation.


Detailed Description

Neighborhood Seed Predation - version 1.1.

This behavior reduces the number of seeds by simulating seed predation. Rate of offtake is a function of neighborhood composition.

This can be used in two forms. In the standalone form, masting is also used to determine offtake. In the linked form, the clFuncResponseSeedPredation class determines the offtake rate, and this class figures out where seeds get eaten. In this case, masting is ignored.

In the standalone version, there are two choices for assessing masting: in the first, masting is assessed by counting the seeds to which this behavior applies and which participate in masting (two different things - the latter is controlled by a boolean parameter ) and comparing it to a density per timestep threshold. Above the threshold is masting; below is not. The second choice is to ask the masting disperse behaviors if any species has masted; if any have, then it is a masting event. (If masting disperse behaviors are not used, then masting never occurs.) The only difference between masting and non-masting timesteps is the parameters used.

For both versions, the proportion of seed removed is calculated as:

logit(Y) = p0 + Σ pn * RBA n
where, summing over the species from n = 1...N, pn is the loading factor for species n, and RBAn is the relative basal area of species n. There is a species specific minimum DBH for neighbors to include.

In the standalone version, this is used directly as the amount of seed removed. In the linked version, it is used to distribute the offtake rate from the functional response seed predation behavior. Conceptually, the local offtake rate is adjusted by a correction factor, calculated by dividing the FR offtake Z by the mean off the local offtakes, so the plot-level offtake remains the same. Mathematically it is a little more complicated:

  1. Calculate logit(Z)
  2. Calculate the logit(Ys) and subtract the minimum value from each (as well as the logit(Z)) so they will all be positive
  3. Average the logit(Y)s
  4. Divide logit(Z) by average logit(Y) to get a correction factor
  5. Multiply each logit(Y) by the correction factor
  6. Add back the same minimum value formerly subtracted
  7. Backtransform logit(Y) to Y and use when removing seeds

A fatal error is thrown if a disperse behavior is not also defined for the run, and additionally if this is linked and the clFuncResponseSeedPredation class is missing.

This class's namestring is "Neighborhood Seed Predation". If standalone, the parameter call string is also "Neighborhood Seed Predation". If linked, the parameter call string is "Linked Neighborhood Seed Predation".


Copyright 2007 Charles D. Canham.

Author:
Lora E. Murphy

Edit history:
-----------------
May 21, 2007 - Created (LEM)
May 13, 2008 - Made linking (LEM)
September 23, 2008 - Added species-specific minimum neighbor DBH; not all species participate in masting (LEM)
April 15, 2008 - Added output grid and made version 1.1 (LEM)
June 16, 2009 - Added as a choice asking disperse behaviors when masting has occurred (LEM)

Constructor & Destructor Documentation

clNeighborhoodSeedPredation::clNeighborhoodSeedPredation ( clSimManager p_oSimManager  ) 

Constructor.

Parameters:
p_oSimManager Sim Manager object.

clNeighborhoodSeedPredation::~clNeighborhoodSeedPredation (  ) 

Destructor.

Frees memory.


Member Function Documentation

void clNeighborhoodSeedPredation::Action (  )  [virtual]

Performs neighborhood seed predation.

If the behavior is in linked mode, this calls DoLinkedPredation. If not, this calls DoStandalonePredation. Before the appropriate predation function is called, this copies the values from the "Dispersed Seeds" grid to the "startseeds_x" data members of the output grid; after the function is called, this calculates and posts the values of the "propeaten_x" data members.

Reimplemented from clBehaviorBase.

void clNeighborhoodSeedPredation::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.

Parameters:
cNameString Behavior name from parameter file.

Reimplemented from clBehaviorBase.

void clNeighborhoodSeedPredation::GetData ( xercesc::DOMDocument *  p_oDoc  )  [protected, virtual]

Does setup.

This reads in values from the parameter file, gets the pointer to the dispersed seeds grid, and sets up the output grid.

Parameters:
p_oDoc DOM tree of parsed input file.
Exceptions:
modelErr if this is linked and there is no functional response seed predation.

Implements clWorkerBase.

void clNeighborhoodSeedPredation::DoStandalonePredation (  )  [protected]

Performs neighborhood seed predation for the standalone version of this behavior.

First, for the whole plot, this assesses whether masting has occurred by comparing the density of seeds of species to which this behavior applies to the threshold. Then for each cell, the neighborhood relative BAs and the proportion to remove is calculated. A random round is used to take care of fractional parts of seeds. This also checks plot adult tree density; if it is zero, it is automatically not a masting time step.

void clNeighborhoodSeedPredation::DoLinkedPredation (  )  [protected]

Performs neighborhood seed predation for the linked version of this behavior.

This calculates all offtakes, then adjusts them according to the offtake calculated by clFuncResponseSeedPredation. A random round is used to take care of fractional parts of seeds.

void clNeighborhoodSeedPredation::GetOfftakes ( clTreePopulation p_oPop,
const float *  p_fP0,
float **  p_fPn,
float *  p_fOfftake,
const int &  iX,
const int &  iY 
) [protected]

Gets the offtake (Y) values for all behavior species for a given grid cell.

Parameters:
p_oPop Tree population object.
p_fP0 p0 values to use, as an array sized m_iNumBehaviorSpecies.
p_fPn pn values to use, as an array sized m_iNumBehaviorSpecies by the total number of species.
p_fOfftake Place to put offtake values, as an array sized m_iNumBehaviorSpecies.
iX Seed grid X cell number.
iY Seed grid Y cell number.
Returns:
Array of offtakes sized m_iNumBehaviorSpecies.

void clNeighborhoodSeedPredation::SetupGrids (  )  [protected]

Gets a pointer to the "Dispersed Seeds" grid, and sets up the output grid.

Exceptions:
modelErr if the seed grid is not found

void clNeighborhoodSeedPredation::ReadParameterFileData ( xercesc::DOMDocument *  p_oDoc  )  [protected]

Reads parameter file data.

Parameters:
p_oDoc DOM tree of parsed input file.
Exceptions:
modelErr if any of the following are negative: neighborhood radius, min neighbor DBH, masting threshold


Member Data Documentation

Pointer to the "Dispersed Seeds" grid created by disperse behaviors.

Grid to output details of seed predation.

The name of this grid is "Neighborhood Seed Predation". Its cell size matches that of the "Dispersed Seeds" grid. For each species there are two data members: "startseeds_x" and "propeaten_x" for the pre-predation seed numbers and proportion eaten, respectively, where X is the species number. Both of the data members are float. Initial conditions maps of this grid are not respected.

Non-masting "p0" parameter.

Array size is number of species to which this behavior applies.

Non-masting pn.

Array size is number of behavior species by number of total species.

Masting "p0" parameter.

Array size is number of species to which this behavior applies.

Minimum neighbor DBH.

Masting pn.

Array size is number of behavior species by number of total species.

Data member codes for seed grid for number of seeds.

Array size is number of species to which this behavior applies.

Data member codes for the "startseeds_x" member of the output grid.

Array size is total number of species.

Data member codes for the "propeaten_x" member of the output grid.

Array size is total number of species.

For accessing the other arrays.

Whether or not a species counts when making masting decisions.

Only necessary if m_bUseThresholdToDecideMast is true.

Area of the plot, in square meters.

Radius of neighborhoods.

Threshold of seeds per square meter for a masting timestep.

This comes as an annual amount in the parameter file and is converted to a timestep amount. Only necessary if m_bUseThresholdToDecideMast is true.

Whether this is the linked (true) or standalone (false) version.

Whether to use a seed density threshold (true) or ask the masting disperse behaviors (false) when deciding whether this is a masting timestep.


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

Generated on Tue Apr 19 13:56:14 2011 for SORTIE Core C++ Documentation by  doxygen 1.5.6