SORTIE Core C++ Documentation
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
clGeneralizedHarvestRegime Class Reference

Generalized Harvest Regime - Version 1.0. More...

#include <GeneralizedHarvestRegime.h>

Inheritance diagram for clGeneralizedHarvestRegime:
clBehaviorBase clWorkerBase

Public Member Functions

 clGeneralizedHarvestRegime (clSimManager *p_oSimManager)
 Constructor.
 
 ~clGeneralizedHarvestRegime ()
 Destructor.
 
void Action ()
 Performs the harvest.
 
void GetData (xercesc::DOMDocument *p_oDoc)
 Performs setup.
 
void RegisterTreeDataMembers ()
 Registers the "Cut Probability" tree float data member.
 
- Public Member Functions inherited from clBehaviorBase
virtual float GetBehaviorVersion ()
 Gets the behavior version number.
 
 clBehaviorBase (clSimManager *p_oSimManager)
 Constructor.
 
virtual ~clBehaviorBase ()
 Destructor.
 
virtual short int ValidateVersionNumber (float fTestVersion)
 Makes sure that the version number of a file passed is between the minimum and current version numbers.
 
virtual void SetSpeciesTypeCombos (short int iNumCombos, stcSpeciesTypeCombo *p_whatCombos)
 Sets the species/type combos for a behavior.
 
virtual void SetNameData (char *cNameString)
 Sets the string for the parameter file behavior.
 
virtual short int GetNewTreeInts ()
 Gets the number of new tree integer data members this behavior wants to register.
 
virtual short int GetNewTreeFloats ()
 Gets the number of new tree float data members this behavior wants to register.
 
virtual short int GetNewTreeChars ()
 Gets the number of new tree character data members this behavior wants to register.
 
virtual short int GetNewTreeBools ()
 Gets the number of new tree bool data members this behavior wants to register.
 
virtual short int GetNumSpeciesTypeCombos ()
 Gets the number of species/type combos to which this behavior applies.
 
virtual short int GetNumBehaviorSpecies ()
 Gets the number of unique tree species to which this behavior applies.
 
struct stcSpeciesTypeCombo GetSpeciesTypeCombo (short int iIndex)
 Gets one of this behavior's type/species combos.
 
virtual short int GetBehaviorSpecies (short int iIndex)
 Gets one of the behavior's species.
 
short int GetBehaviorListNumber ()
 Gets the behavior list number for this behavior, which differentiates between multiple copies of the behavior in the behavior list.
 
void SetBehaviorListNumber (short int iNumber)
 Sets the behavior list number for this behavior, which differentiates between multiple copies of the behavior in the behavior list.
 
virtual DOMElement * GetParentParametersElement (xercesc::DOMDocument *p_oDoc)
 Formats the string for species/types query.
 
- Public Member Functions inherited from clWorkerBase
 clWorkerBase (clSimManager *p_oSimManager)
 Constructor.
 
virtual ~clWorkerBase ()
 Destructor.
 
char * GetName ()
 Gets the object's namestring.
 
void DoObjectSetup (xercesc::DOMDocument *p_oDoc, fileType iFileType)
 Triggers the setup process.
 
virtual void TimestepCleanup ()
 Performs any necessary cleanup operations at the end of a timestep.
 
virtual void EndOfRunCleanup ()
 Performs any necessary cleanup operations at the end of a run.
 
virtual void DoCommand (char *cCommand, char *cArguments)
 If a behavior has registered a command line command with the sim manager, this allows it to be called.
 

Protected Member Functions

void ReadHarvestParameterFileData (xercesc::DOMDocument *p_oDoc)
 Reads harvest data from the parameter file.
 
bool CutThisTimestep ()
 Decides whether or not a harvest will occur this timestep.
 
void GetDataCodes ()
 Gets the "Biomass" data member code for adults of each species.
 

Protected Attributes

clTreePopulationmp_oPop
 Stashed pointer to tree population.
 
short int * mp_iBiomassCode
 Code for the "Biomass" float data member for adults of each species.
 
short int * mp_iHarvestCode
 Code for the "Gen Harvest" bool data member for adults of each species.
 
float * mp_fCutProbAlpha
 Alpha in the species specific cut probability function.
 
float * mp_fCutProbBeta
 Beta in the species specific cut probability function.
 
float * mp_fCutProbGamma
 Gamma in the species specific cut probability function.
 
float * mp_fCutProbMu
 Mu in the species specific cut probability function.
 
float m_fLogProbA
 Probability of logging a.
 
float m_fLogProbM
 Probability of logging m.
 
float m_fLogProbB
 Probability of logging b.
 
float m_fRemoveA
 Removal amount alpha.
 
float m_fRemoveB
 Removal amount beta.
 
float m_fRemoveM
 Removal amount mu.
 
float m_fScale
 Gamma random draw scale parameter.
 
float m_fCutProbA
 A in the function for calculating sigma in the cut probability function.
 
float m_fCutProbB
 B in the function for calculating sigma in the cut probability function.
 
float m_fCutProbC
 C in the function for calculating sigma in the cut probability function.
 
float m_fAllowedRange
 Allowed max deviation from desired BA for one-pass harvesting.
 
float m_fTotalBA
 Total plot BA this timestep.
 
float m_fTotalBiomass
 Total plot biomass this timestep.
 
int m_iNumSpecies
 Total number of species.
 
deadCode m_iReasonCode
 Reason code to pass to the tree population when trees are killed.
 
- Protected Attributes inherited from clBehaviorBase
short int m_iNumSpeciesTypeCombos
 How many type/species combos a behavior will act on.
 
short int m_iNumBehaviorSpecies
 How many distinct species are in the combo list - important for filling species-specific values from parameter file.
 
short int * mp_iWhatSpecies
 List of distinct species - for filling species-specific values from parameter file.
 
stcSpeciesTypeCombomp_whatSpeciesTypeCombos
 Array of species/type combos that the behavior will act on.
 
short int m_iNewTreeInts
 The number of new tree integer data members this behavior wants to add.
 
short int m_iNewTreeFloats
 The number of new tree float data members this behavior wants to add.
 
short int m_iNewTreeChars
 The number of new tree character data members this behavior wants to add.
 
short int m_iNewTreeBools
 The number of new tree boolean data members this behavior wants to add.
 
short int m_iBehaviorListNumber
 The number of this behavior in the behavior list, to differentiate between possible multiple copies of this behavior.
 
float m_fVersionNumber
 Version number - this will be rounded to 2 digits after the decimal place.
 
std::string m_sXMLRoot
 XML root that encloses the parameters for this behavior.
 
float m_fMinimumVersionNumber
 Minimum version number - this behavior will run parameter data for a file marked between this number and the current version number, inclusive.
 
- Protected Attributes inherited from clWorkerBase
char m_cNameString [MAX_NAMESTRING_SIZE]
 Object's identifying namestring.
 
int * mp_iAllowedFileTypes
 List of the input file types this object can handle.
 
int m_iNumAllowedTypes
 Number of input file types this object can handle.
 

Additional Inherited Members

- Static Protected Attributes inherited from clWorkerBase
static clSimManagermp_oSimManager
 Pointer to the simulation manager object.
 

Detailed Description

Generalized Harvest Regime - Version 1.0.

Logs based on plot basal area and biomass.

The probability that the plot is logged in a given time step is a function of the total plot biomass, as follows: P = a * exp(-m * X^b) Where P is the probability, X is the total plot adult biomass in Mg/ha, and a, m, and b are the log probability parameters. This is evaluated each time step; it does not matter whether logging occurred the previous time step.

If the plot is to be logged, the amount of adult basal area to remove is: BAR = alpha * exp(-mu * X^beta) where BAR is the percentage to remove (between 0 and 100), X is the total plot adult biomass, and alpha, beta, and mu are removal parameters. This percentage is then used as the mean in a draw on a gamma distribution.

Individual trees have a cut preference function as follows: P = (1 - gamma * exp(-beta * R ^ alpha)) * (exp(-0.5*((DBH - mu)/sigma)^2)) where P is the cut probability, R is the plot percentage of BA to remove, gamma, beta, alpha, and mu are species-specific removal probability parameters, and sigma is a + b * R^c, where a, b, and c are parameters.

Each tree's removal probability is then compared with a random number to determine whether or not it will be removed. The removal probabilities cannot be depended upon to average the target percent of basal area to remove; so if the removed amount is not within a designated range of the target, a second pass will be made through the trees with all probabilities adjusted either up or down in order to get closer to the target. No more than two passes will be made.

All adults of all species must participate. All must have "Dimension Analysis" applied. Seedlings and saplings are always ignored by this behavior.

The parameter file call string and namestring are "GeneralizedHarvestRegime".

Copyright 2011 Charles D. Canham.

Author
Lora E. Murphy


Edit history:
--------------—
January 16, 2011 - Created (LEM)

Constructor & Destructor Documentation

clGeneralizedHarvestRegime::clGeneralizedHarvestRegime ( clSimManager p_oSimManager)

Constructor.

Parameters
p_oSimManagerSim Manager object.
clGeneralizedHarvestRegime::~clGeneralizedHarvestRegime ( )

Destructor.

Member Function Documentation

void clGeneralizedHarvestRegime::Action ( )
virtual

Performs the harvest.

CutThisTimestep() is called to determine whether a harvest occurs.

Reimplemented from clBehaviorBase.

bool clGeneralizedHarvestRegime::CutThisTimestep ( )
protected

Decides whether or not a harvest will occur this timestep.

This gets the total amount of biomass and evaluates the probability equation. The result is compared to a random number to determine logging probability.

While this is totaling biomass, it will also total basal area for m_fTotalBA.

Returns
True if logging is to occur, false if not.
void clGeneralizedHarvestRegime::GetData ( xercesc::DOMDocument *  p_oDoc)
virtual

Performs setup.

This calls:

  • ReadHarvestParameterFileData
  • GetDataCodes
Parameters
p_oDocDOM tree of parsed input file.

Implements clWorkerBase.

void clGeneralizedHarvestRegime::GetDataCodes ( )
protected

Gets the "Biomass" data member code for adults of each species.

Exceptions
modelErrif there is a missing code.
void clGeneralizedHarvestRegime::ReadHarvestParameterFileData ( xercesc::DOMDocument *  p_oDoc)
protected

Reads harvest data from the parameter file.

Parameters
p_oDocDOM tree of parsed input file.
void clGeneralizedHarvestRegime::RegisterTreeDataMembers ( )
virtual

Registers the "Cut Probability" tree float data member.

The return codes are captured in the mp_iCutProbCode array.

Exceptions
modelErrif this behavior is not applied to adults of all species, or is applied to anything else.

Reimplemented from clBehaviorBase.

Member Data Documentation

float clGeneralizedHarvestRegime::m_fAllowedRange
protected

Allowed max deviation from desired BA for one-pass harvesting.

float clGeneralizedHarvestRegime::m_fCutProbA
protected

A in the function for calculating sigma in the cut probability function.

float clGeneralizedHarvestRegime::m_fCutProbB
protected

B in the function for calculating sigma in the cut probability function.

float clGeneralizedHarvestRegime::m_fCutProbC
protected

C in the function for calculating sigma in the cut probability function.

float clGeneralizedHarvestRegime::m_fLogProbA
protected

Probability of logging a.

float clGeneralizedHarvestRegime::m_fLogProbB
protected

Probability of logging b.

float clGeneralizedHarvestRegime::m_fLogProbM
protected

Probability of logging m.

float clGeneralizedHarvestRegime::m_fRemoveA
protected

Removal amount alpha.

float clGeneralizedHarvestRegime::m_fRemoveB
protected

Removal amount beta.

float clGeneralizedHarvestRegime::m_fRemoveM
protected

Removal amount mu.

float clGeneralizedHarvestRegime::m_fScale
protected

Gamma random draw scale parameter.

float clGeneralizedHarvestRegime::m_fTotalBA
protected

Total plot BA this timestep.

float clGeneralizedHarvestRegime::m_fTotalBiomass
protected

Total plot biomass this timestep.

int clGeneralizedHarvestRegime::m_iNumSpecies
protected

Total number of species.

deadCode clGeneralizedHarvestRegime::m_iReasonCode
protected

Reason code to pass to the tree population when trees are killed.

float* clGeneralizedHarvestRegime::mp_fCutProbAlpha
protected

Alpha in the species specific cut probability function.

Array size is total number of species.

float* clGeneralizedHarvestRegime::mp_fCutProbBeta
protected

Beta in the species specific cut probability function.

Array size is total number of species.

float* clGeneralizedHarvestRegime::mp_fCutProbGamma
protected

Gamma in the species specific cut probability function.

Array size is total number of species.

float* clGeneralizedHarvestRegime::mp_fCutProbMu
protected

Mu in the species specific cut probability function.

Array size is total number of species.

short int* clGeneralizedHarvestRegime::mp_iBiomassCode
protected

Code for the "Biomass" float data member for adults of each species.

short int* clGeneralizedHarvestRegime::mp_iHarvestCode
protected

Code for the "Gen Harvest" bool data member for adults of each species.

clTreePopulation* clGeneralizedHarvestRegime::mp_oPop
protected

Stashed pointer to tree population.


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