#include <StormDirectKiller.h>
Public Member Functions | |
clStormDirectKiller (clSimManager *p_oSimManager) | |
Constructor. | |
~clStormDirectKiller () | |
Destructor. | |
void | GetData (xercesc::DOMDocument *p_oDoc) |
Does behavior setup. | |
void | Action () |
Applies storm damage to trees. | |
Protected Member Functions | |
void | GetParameterFileData (xercesc::DOMDocument *p_oDoc, clTreePopulation *p_oPop) |
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 | GetGridInfo () |
Gets the pointer to the "Storm Damage" grid and its appropriate data members. | |
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_fA |
Storm "a" parameter. | |
float * | mp_fB |
Storm "b" parameter. | |
int ** | mp_iDeadCodes |
Return codes for the "dead" bool tree data member. | |
int | m_iNumTypes |
Number of total types. | |
int | m_iDmgIndexCode |
Return code for the "1dmg_index" float data member of the "Storm Damage" grid. |
This kills trees directly after a storm based solely on the damage at their location. 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.
A given tree's probability of mortality is
This behavior will use a random number to determine whether a tree dies based on its probability of mortality. A tree that dies gets its "dead" flag set to true. (This flag comes from mortality behaviors and is not added by this behavior.)
The call string for this is "storm direct killer".
Edit history:
-----------------
December 13, 2007 - Created (LEM)
clStormDirectKiller::clStormDirectKiller | ( | clSimManager * | p_oSimManager | ) |
clStormDirectKiller::~clStormDirectKiller | ( | ) |
Destructor.
void clStormDirectKiller::GetData | ( | xercesc::DOMDocument * | p_oDoc | ) | [virtual] |
void clStormDirectKiller::Action | ( | ) | [virtual] |
Applies storm damage to 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 mortality for each storm that occurred in the current timestep. Random numbers are used to determine which trees die.
Reimplemented from clBehaviorBase.
void clStormDirectKiller::GetParameterFileData | ( | xercesc::DOMDocument * | p_oDoc, | |
clTreePopulation * | p_oPop | |||
) | [protected] |
Reads parameter file data.
p_oDoc | Parsed parameter file. | |
p_oPop | Tree population object. |
void clStormDirectKiller::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 clStormDirectKiller::GetDeadCodes | ( | clTreePopulation * | p_oPop | ) | [protected] |
Gets codes for the "dead" data member for each tree type to which this behavior applies.
p_oPop | Tree population object. |
modelErr | if the codes are not available for every tree type to which this behavior is applied. |
void clStormDirectKiller::GetGridInfo | ( | ) | [protected] |
Gets the pointer to the "Storm Damage" grid and its appropriate data members.
modelErr | if the "Storm Damage" grid has not been created. |
clGridBase* clStormDirectKiller::mp_oStormDamageGrid [protected] |
Pointer to the "Storm Damage" grid.
This grid is created by clStorm.
char* clStormDirectKiller::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* clStormDirectKiller::mp_fA [protected] |
Storm "a" parameter.
Array size is total number of species. From the parameter file.
float* clStormDirectKiller::mp_fB [protected] |
Storm "b" parameter.
Array size is total number of species. From the parameter file.
int** clStormDirectKiller::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 clStormDirectKiller::m_iNumTypes [protected] |
Number of total types.
int clStormDirectKiller::m_iDmgIndexCode [protected] |
Return code for the "1dmg_index" float data member of the "Storm Damage" grid.