clBoleVolumeCalculator Class Reference

Bole Volume Calculator Version 1.0. More...

#include <BoleVolumeCalculator.h>

Inheritance diagram for clBoleVolumeCalculator:

clBehaviorBase clWorkerBase List of all members.

Public Member Functions

 clBoleVolumeCalculator (clSimManager *p_oSimManager)
 Constructor.
 ~clBoleVolumeCalculator ()
 Destructor.
void Action ()
 Makes volume calculations.
void GetData (xercesc::DOMDocument *p_oDoc)
 Does setup for this behavior.
void RegisterTreeDataMembers ()
 Registers the "Bole Vol" float data member.

Protected Member Functions

int GetBoleHeight (const float &fDBH, const int &iSpecies)
 Gets the merchantable bole height of a tree.
void GetParameterFileData (xercesc::DOMDocument *p_oDoc)
 Reads values from the parameter file.
void FormatQueryString ()
 Formats the string in m_cQuery.
void PopulateTaperTable ()
 Populates the taper table.

Protected Attributes

float * mp_fB0
 b0 in the volume equation.
float * mp_fB1
 b1 in the volume equation.
float * mp_fB2
 b2 in the volume equation.
float * mp_fB3
 b3 in the volume equation.
float * mp_fB4
 b4 in the volume equation.
float * mp_fB5
 b5 in the volume equation.
float * mp_fFormClass
 Form classes.
float ** mp_fTaperTable
 Taper table.
short int * mp_iIndexes
 For quick access to the species-specific arrays.
char * m_cQuery
 String to pass to clTreePopulation::Find() in order to get the trees for which to calculate volume.
short int ** mp_iVolumeCodes
 Holds data member codes for "Bole Vol" float data member.
short int m_iMaxLogs
 The maximum number of logs a tree can have.
short int m_iDBHIncs
 Number of DBH increments in the taper table.

Detailed Description

Bole Volume Calculator Version 1.0.

This class calculates merchantable tree volume according to a US Forest Service equation. The volume value is stored in an float tree data member that this behavior adds as a value in cubic feet.

Tree volume is calculated as follows:

V = b0 + b1*DBHb2 + b3* DBHb4 * Heightb5

Where:

The bole length is the number of 16-foot logs the tree can provide. The base of the bole is the top of the cut stump (whatever that is; it's ignored by this behavior); the top of the bole is the merchantable height. This behavior defines the merchantable height as the height at which the trunk diameter inside the bark tapers to 60% of DBH.

To determine at what bole length the merchantable height occurs, we try fitting as many 16-foot logs as possible in to see how many fit before the 60% taper occurs. The amount of taper at the top of the first 16-foot log is established by the form classes and is a fixed percentage entered by the user as a parameter.

The amount of taper at the top of the first 16-foot log is subtracted from the DBH, to see how much taper is left before the 60% merchantable-height taper is reached. There is no formula that establishes clearly how many logs will fit; we use a trial-and-error approach on a table until we find the correct number of logs. The table below, adapted from Messavage and Girard, is contained in the code. It represents the amount of taper at the top of the last log in a tree containing different numbers of logs.
DBH (in)2-log3-log4-log5-log6-log
101.42.6------
121.62.84.4----
141.734.7----
161.93.24.9----
1823.45.2----
202.13.65.67.8--
222.23.85.98--
242.346.38.4--
262.44.26.58.7--
282.54.46.8912
302.64.67.29.412.1
322.74.77.39.912.3
342.84.87.610.212.6
362.84.97.810.413
382.94.97.910.513.4
402.95810.913.9

Consider a maple tree with a 20-inch DBH. The user enters its form class as 79%. We calculate the merchantable height to be that height at which the tree diameter inside the bark is 20 * 0.6 = 12 inches. The diameter at the top of the first 16-foot log = 20 * 0.79 = 15.8 inches.

The diameter at merchantable height is 12 inches; at the top of the first log it is 15.8 inches. This means there is 3.8 inches of taper available left. The next job is to use the lookup table to determine how many logs will fit into this amount of taper.

Our DBH is 20 inches, which has an entry for itself in the lookup table. If our DBH was not an even multiple of 2 inches, we would round down to the next lowest multiple of 2. Any tree larger than 40 inches of DBH will use the 40-inch entry. Trees must have a DBH of at least 10 inches to get a volume.

We begin by assuming that our tree is a 2-log tree. The amount of taper to the top of the second log in the table is given as 2.1. This means our diameter at the top of the second log is 15.8 – 2.1 = 13.7 inches. This is greater than 12 inches; so we will go back and try to fit three logs in.

For a 3-log tree of 20 inches, the taper at the top of the third log is 3.6 inches. The diameter at the top of this log is 15.8 – 3.6 = 12.2. This is still greater than 12, so we will try to fit in four logs.

The diameter at the top of the fourth log of a 4-log tree of 20 inches DBH is 15.8 – 1.4 – 1.8 – 2.4, or 10.2. This is less than 12. Thus, 4 logs don’t fit. Our bole length is 3 * 16 = 48 feet.

This behavior adds an float data member called "Bole Vol" to trees that holds the final volume calculation as a value in square meters.

This class's namestring and parameter call string are both "tree bole volume calculator".

This behavior may not be applied to seedlings.


Constructor & Destructor Documentation

clBoleVolumeCalculator::clBoleVolumeCalculator ( clSimManager p_oSimManager  ) 

Constructor.

Parameters:
p_oSimManager clSimManager object.

clBoleVolumeCalculator::~clBoleVolumeCalculator (  ) 

Destructor.

Deletes arrays.


Member Function Documentation

void clBoleVolumeCalculator::Action (  )  [virtual]

Makes volume calculations.

A query is sent to the tree population to get all trees to which this behavior is applied. For each, the volume is calculated by GetTreeVolume(). This value is placed in the "Bole Vol" float tree data member.

Reimplemented from clBehaviorBase.

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

Does setup for this behavior.

Calls:

  1. GetParameterFileData
  2. FormatQueryString
  3. PopulateTaperTable
  4. Action() so that the initial conditions volume will be added
Parameters:
p_oDoc DOM tree of parsed input file.

Implements clWorkerBase.

void clBoleVolumeCalculator::RegisterTreeDataMembers (  )  [virtual]

Registers the "Bole Vol" float data member.

The return codes are captured in the mp_iVolumeCodes array.

Exceptions:
modelErr if this behavior is being applied to any tree type except saplings, adults, and snags.

Reimplemented from clBehaviorBase.

int clBoleVolumeCalculator::GetBoleHeight ( const float &  fDBH,
const int &  iSpecies 
) [protected]

Gets the merchantable bole height of a tree.

This function calculates the taper to the top of the first log using the form class for the species. After determining how much taper is left, it uses the taper table to determine how many logs to add. It determines the DBH increment index by rounding down to the nearest even number and subtracting 10 (with a max index of 15). Then, for that index, it moves from 0 to m_iMaxLogs across the table until it finds the greatest entry that is less than or equal to the remaining taper. That array index is equal to the number of logs to add to the first one. Then the result is multiplied by 16 and returned.

This function does not weed out trees with a DBH of less than 10 inches.

Parameters:
fDBH SORTIE's DBH value, in in
iSpecies Tree's species.
Returns:
Bole height as an integer number of feet.

void clBoleVolumeCalculator::GetParameterFileData ( xercesc::DOMDocument *  p_oDoc  )  [protected]

Reads values from the parameter file.

Parameters:
p_oDoc DOM tree of parsed input file.
Exceptions:
modelErr if any value for form class is less than 60%.

void clBoleVolumeCalculator::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 clBoleVolumeCalculator::PopulateTaperTable (  )  [protected]

Populates the taper table.

The taper array is declared and the values populated according to the values in the documentation above.


Member Data Documentation

float* clBoleVolumeCalculator::mp_fB0 [protected]

b0 in the volume equation.

Array size is # behavior species.

float* clBoleVolumeCalculator::mp_fB1 [protected]

b1 in the volume equation.

Array size is # behavior species.

float* clBoleVolumeCalculator::mp_fB2 [protected]

b2 in the volume equation.

Array size is # behavior species.

float* clBoleVolumeCalculator::mp_fB3 [protected]

b3 in the volume equation.

Array size is # behavior species.

float* clBoleVolumeCalculator::mp_fB4 [protected]

b4 in the volume equation.

Array size is # behavior species.

float* clBoleVolumeCalculator::mp_fB5 [protected]

b5 in the volume equation.

Array size is # behavior species.

float* clBoleVolumeCalculator::mp_fFormClass [protected]

Form classes.

This is the proportion of DBH that the diameter is at the top of the first log. This is entered by the user as a percentage between 60 and 100 but to save math we convert to a proportion and subtract it from 1 so it's the inverse. Array size is # behavior species.

float** clBoleVolumeCalculator::mp_fTaperTable [protected]

Taper table.

This is the amount by which diameter is reduced, in inches, at the top of the last log in a 2-, 3-, 4-, 5-, or 6-log tree. First array index is 16 (m_iDBHIncs, DBH in 2-in increments from 10 to 40 inches); second index is 6 (m_iMaxLogs).

short int* clBoleVolumeCalculator::mp_iIndexes [protected]

For quick access to the species-specific arrays.

Array size is # total species.

char* clBoleVolumeCalculator::m_cQuery [protected]

String to pass to clTreePopulation::Find() in order to get the trees for which to calculate volume.

This will instigate a species/type search for all the species and types to which this behavior applies.

short int** clBoleVolumeCalculator::mp_iVolumeCodes [protected]

Holds data member codes for "Bole Vol" float data member.

First array index is # behavior species, second is number types (3 - sapling, adult, snag)

short int clBoleVolumeCalculator::m_iMaxLogs [protected]

The maximum number of logs a tree can have.

Equal to 6.

short int clBoleVolumeCalculator::m_iDBHIncs [protected]

Number of DBH increments in the taper table.

Equal to 16 (DBH in 2-in increments from 10 to 40 inches).


The documentation for this class was generated from the following file:
Generated on Thu May 24 09:30:42 2007 for SORTIE Core C++ Documentation by  doxygen 1.5.2