#include <StormKiller.h>
Inheritance diagram for clStormKiller:
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 | |
clGridBase * | mp_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. |
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:
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.
|
|
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. |
|
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. |
|
Does behavior setup.
Implements clWorkerBase. |
|
Gets codes for the "dead" data member for each tree type to which this behavior applies.
|
|
Reads parameter file data.
|
|
Gets codes for the "stm_dmg" data member for each tree type to which this behavior applies.
|
|
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. |
|
Number of years snags stick around. From the parameter file. |
|
The minimum DBH, in cm, for trees that can be damaged by storms. Array size is total number of species. From the parameter file. |
|
Proportion of dead heavy-damaged trees that tip-up, between 0 and 1. Array size is total number of species. From the parameter file. |
|
Heavy damage a. Array size is total number of species. From the parameter file. |
|
Heavy damage b. Array size is total number of species. From the parameter file. |
|
Medium damage a. Array size is total number of species. From the parameter file. |
|
Medium damage b. Array size is total number of species. From the parameter file. |
|
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. |
|
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. |
|
Pointer to the "Storm Damage" grid. This grid is created by clStorm. |