clStormDirectKiller Class Reference

Storm Direct Killer - Version 1.0. More...

#include <StormDirectKiller.h>

Inheritance diagram for clStormDirectKiller:

clBehaviorBase clWorkerBase

List of all members.

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

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_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.


Detailed Description

Storm Direct Killer - Version 1.0.

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

P = exp(a + b * s) / (1 + exp(a + b * s)))
where:

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 "storm". (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)


Constructor & Destructor Documentation

clStormDirectKiller::clStormDirectKiller ( clSimManager p_oSimManager  ) 

Constructor.

Parameters:
p_oSimManager clSimManager object.

clStormDirectKiller::~clStormDirectKiller (  ) 

Destructor.


Member Function Documentation

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

Does behavior setup.

Calls:

  1. GetParameterFileData()
  2. FormatQueryString()
  3. GetDeadCodes()
  4. GetGridInfo()
Parameters:
p_oDoc Parsed parameter file.

Implements clWorkerBase.

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. Those that die get their "dead" flag set to "storm".

Reimplemented from clBehaviorBase.

void clStormDirectKiller::GetParameterFileData ( xercesc::DOMDocument *  p_oDoc,
clTreePopulation p_oPop 
) [protected]

Reads parameter file data.

Parameters:
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.

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 clStormDirectKiller::GetGridInfo (  )  [protected]

Gets the pointer to the "Storm Damage" grid and its appropriate data members.

Exceptions:
modelErr if the "Storm Damage" grid has not been created.


Member Data Documentation

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.

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.

Number of total types.

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


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

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