clStormKiller Class Reference

Storm Killer - Version 1.0. More...

#include <StormKiller.h>

Inheritance diagram for clStormKiller:

clBehaviorBase clWorkerBase List of all members.

Public Member Functions

 clStormKiller (clSimManager *p_oSimManager)
 Constructor.
 ~clStormKiller ()
 Destructor.
void GetData (xercesc::DOMDocument *p_oDoc)
 Does behavior setup.
void Action ()
 Kills storm-damaged trees.

Protected Member Functions

void GetParameterFileData (xercesc::DOMDocument *p_oDoc)
 Reads parameter file data.
void FormatQueryString ()
 Formats the string in m_cQuery.
void GetDeadCodes (clTreePopulation *p_oPop)
 Gets codes for the "dead" data member for each tree type to which this behavior applies.
void GetStmDmgCodes ()
 Gets codes for the "stm_dmg" data member for each tree type to which this behavior applies.

Protected Attributes

clGridBasemp_oStormDamageGrid
 Pointer to the "Storm Damage" grid.
char * m_cQuery
 String to pass to clTreePopulation::Find() in order to get the trees to apply damage to.
float * mp_fMinStormDBH
 The minimum DBH, in cm, for trees that can be damaged by storms.
float * mp_fStmDmgMedA
 Medium damage a.
float * mp_fStmDmgHeavyA
 Heavy damage a.
float * mp_fStmDmgMedB
 Medium damage b.
float * mp_fStmDmgHeavyB
 Heavy damage b.
float * mp_fPropTipUp
 Proportion of dead heavy-damaged trees that tip-up, between 0 and 1.
int ** mp_iStmDmgCodes
 Return codes for the "stm_dmg" int tree data member.
int ** mp_iDeadCodes
 Return codes for the "dead" bool tree data member.
int m_iSnagYears
 Number of years snags stick around.
int m_iNumTypes
 Number of total types (despite the fact that this behavior won't deal with all of them).
int m_iDmgIndexCode
 Return code for the "dmg_index" float data member of the "Storm Damage" grid.

Detailed Description

Storm Killer - Version 1.0.

The storm killer kills trees that are storm-damaged.

Whether storms have occurred is assessed by clStorm. This behavior uses the values in the "Storm Damage" grid for storm severity, with 0 meaning that no storm has occurred. Damage as a result of the storm is assessed by clStormDamageApplier. Damage is either none, medium, or heavy.

If a tree has medium or heavy damage, its probability of survival is:

P(i) = exp(ai + bi * DBH) / (1 + exp(ai + bi * DBH))
where:

There is a minimum DBH for which to apply storms for each species. Set this to zero if storms apply to all trees.

Once the probability for survival has been assessed, this behavior uses a random number to determine whether or not the tree actually dies. Dead heavy damaged trees have an additional probability of becoming a tip-up. Damaged trees can only die the timestep the storm occurs.

If this behavior is applied to snags, then dead non-tip-ups become snags. This behavior sets a counter which holds time-since-damage and the damage level that killed them (even if they already had higher damage as an alive tree). After the value in the snag lifetime parameter, these snags are removed. Snags not created by this behavior are not touched.

If this behavior is applied to snags, tip-ups become snags whose "dead" flag is set to true. (This flag comes from mortality behaviors and is not added by this behavior.) This behavior then has nothing more to do with these trees.

If this behavior is not applied to snags, then all trees that die get their "dead" flags set to true. (This flag comes from mortality behaviors and is not added by this behavior.) This behavior then has nothing more to do with these trees.

This behavior cannot be applied to seedlings. The clStormDamageApplier behavior is required.

The namestring and parameter file call string for this is "storm killer".


Edit history:
-----------------
January 6, 2006 - Created by splitting off from the original storm damage applier (LEM)


Constructor & Destructor Documentation

clStormKiller::clStormKiller ( clSimManager p_oSimManager  ) 

Constructor.

Parameters:
p_oSimManager clSimManager object.


Member Function Documentation

void clStormKiller::GetData ( xercesc::DOMDocument *  p_oDoc  )  [virtual]

Does behavior setup.

  1. Calls GetParameterFileData() to read in values from the parameter file.
  2. Calls FormatQueryString().
  3. Gets a pointer to the "Storm Damage" grid.
  4. Calls GetStmDmgCodes() to get the appropriate tree data member codes.
Parameters:
p_oDoc Parsed parameter file.
Exceptions:
modelErr if the "Storm Damage" grid has not been created.

Implements clWorkerBase.

void clStormKiller::Action (  )  [virtual]

Kills storm-damaged trees.

It uses the value in m_cQuery to get the trees to which this behavior applies. Then, for each tree, it will assess its probability of survival based on its damage and randomly pick whether or not to kill it. Trees with heavy damage are assessed for the possibility of tip-up by comparing another random number to mp_fPropTipUp.

If we have values of -1 for stm_dmg for snags, then all dead are "killed" by getting their "dead" tree data member set to true. Otherwise, they are passed as killed with a code of "storm" to the tree population. If they were tip-up, then their "dead" tree data member is set to true.

Reimplemented from clBehaviorBase.

void clStormKiller::GetParameterFileData ( xercesc::DOMDocument *  p_oDoc  )  [protected]

Reads parameter file data.

Parameters:
p_oDoc Parsed parameter file.
Exceptions:
modelErr if:
  • The value for m_iSnagYears is not greater than or equal to 0
  • The value in proportion that become tip-ups is not between 0 and 1

void clStormKiller::FormatQueryString (  )  [protected]

Formats the string in m_cQuery.

This value will be used in Action() to pass to clTreePopulation::Find() in order to get the trees to act on.

void clStormKiller::GetDeadCodes ( clTreePopulation p_oPop  )  [protected]

Gets codes for the "dead" data member for each tree type to which this behavior applies.

Parameters:
p_oPop Tree population object.
Exceptions:
modelErr if the codes are not available for every tree type to which this behavior is applied.

void clStormKiller::GetStmDmgCodes (  )  [protected]

Gets codes for the "stm_dmg" data member for each tree type to which this behavior applies.

Exceptions:
modelErr if the codes are not available for every tree type to which this behavior is applied, or if this behavior is being applied to seedlings.


Member Data Documentation

clGridBase* clStormKiller::mp_oStormDamageGrid [protected]

Pointer to the "Storm Damage" grid.

This grid is created by clStorm.

char* clStormKiller::m_cQuery [protected]

String to pass to clTreePopulation::Find() in order to get the trees to apply damage to.

This will instigate a species/type search for all the species and types to which this behavior applies.

float* clStormKiller::mp_fMinStormDBH [protected]

The minimum DBH, in cm, for trees that can be damaged by storms.

Array size is total number of species. From the parameter file.

float* clStormKiller::mp_fStmDmgMedA [protected]

Medium damage a.

Array size is total number of species. From the parameter file.

float* clStormKiller::mp_fStmDmgHeavyA [protected]

Heavy damage a.

Array size is total number of species. From the parameter file.

float* clStormKiller::mp_fStmDmgMedB [protected]

Medium damage b.

Array size is total number of species. From the parameter file.

float* clStormKiller::mp_fStmDmgHeavyB [protected]

Heavy damage b.

Array size is total number of species. From the parameter file.

float* clStormKiller::mp_fPropTipUp [protected]

Proportion of dead heavy-damaged trees that tip-up, between 0 and 1.

Array size is total number of species. From the parameter file.

int** clStormKiller::mp_iStmDmgCodes [protected]

Return codes for the "stm_dmg" int tree data member.

Array index one is sized m_iNumTypes; array index two is sized total number of species.

int** clStormKiller::mp_iDeadCodes [protected]

Return codes for the "dead" bool tree data member.

Array index one is sized m_iNumTypes; array index two is sized total number of species.

int clStormKiller::m_iSnagYears [protected]

Number of years snags stick around.

From the parameter file.

int clStormKiller::m_iNumTypes [protected]

Number of total types (despite the fact that this behavior won't deal with all of them).

int clStormKiller::m_iDmgIndexCode [protected]

Return code for the "dmg_index" float data member of the "Storm Damage" grid.


The documentation for this class was generated from the following file:
Generated on Thu May 24 09:30:45 2007 for SORTIE Core C++ Documentation by  doxygen 1.5.2