#include <GeneralizedHarvestRegime.h>
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. | |
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 | |
clTreePopulation * | mp_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_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. |
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) where BAR is the percentage to remove (between 0 and 100), X is the total plot adult biomass, and alpha 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 "Generalized Harvest Regime".
Copyright 2011 Charles D. Canham.
clGeneralizedHarvestRegime::clGeneralizedHarvestRegime | ( | clSimManager * | p_oSimManager | ) |
Constructor.
p_oSimManager | Sim Manager object. |
clGeneralizedHarvestRegime::~clGeneralizedHarvestRegime | ( | ) |
Destructor.
void clGeneralizedHarvestRegime::Action | ( | ) | [virtual] |
Performs the harvest.
CutThisTimestep() is called to determine whether a harvest occurs.
Reimplemented from clBehaviorBase.
void clGeneralizedHarvestRegime::GetData | ( | xercesc::DOMDocument * | p_oDoc | ) | [virtual] |
Performs setup.
This calls:
p_oDoc | DOM tree of parsed input file. |
Implements clWorkerBase.
void clGeneralizedHarvestRegime::RegisterTreeDataMembers | ( | ) | [virtual] |
Registers the "Cut Probability" tree float data member.
The return codes are captured in the mp_iCutProbCode array.
modelErr | if this behavior is not applied to adults of all species, or is applied to anything else. |
Reimplemented from clBehaviorBase.
void clGeneralizedHarvestRegime::ReadHarvestParameterFileData | ( | xercesc::DOMDocument * | p_oDoc | ) | [protected] |
Reads harvest data from the parameter file.
p_oDoc | DOM tree of parsed input file. |
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.
void clGeneralizedHarvestRegime::GetDataCodes | ( | ) | [protected] |
Gets the "Biomass" data member code for adults of each species.
modelErr | if there is a missing code. |
clTreePopulation* clGeneralizedHarvestRegime::mp_oPop [protected] |
Stashed pointer to tree population.
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.
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.
float clGeneralizedHarvestRegime::m_fLogProbA [protected] |
Probability of logging a.
float clGeneralizedHarvestRegime::m_fLogProbM [protected] |
Probability of logging m.
float clGeneralizedHarvestRegime::m_fLogProbB [protected] |
Probability of logging b.
float clGeneralizedHarvestRegime::m_fRemoveA [protected] |
Removal amount alpha.
float clGeneralizedHarvestRegime::m_fRemoveM [protected] |
Removal amount mu.
float clGeneralizedHarvestRegime::m_fScale [protected] |
Gamma random draw scale parameter.
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_fAllowedRange [protected] |
Allowed max deviation from desired BA for one-pass harvesting.
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.