#include <CarbonValueCalculator.h>
Inheritance diagram for clCarbonValueCalculator:
Public Member Functions | |
clCarbonValueCalculator (clSimManager *p_oSimManager) | |
Constructor. | |
~clCarbonValueCalculator () | |
Destructor. | |
void | Action () |
Makes value calculations. | |
void | GetData (xercesc::DOMDocument *p_oDoc) |
Does setup for this behavior. | |
Protected Member Functions | |
void | GetBiomassCodes (clTreePopulation *p_oPop) |
Retrieves the "Biomass" float data member. | |
void | GetParameterFileData (xercesc::DOMDocument *p_oDoc, clTreePopulation *p_oPop) |
Reads values from the parameter file. | |
void | FormatQueryString (clTreePopulation *p_oPop) |
Formats the string in m_cQuery. | |
void | SetupGrid () |
Sets up the "Carbon Value" grid. | |
Protected Attributes | |
clGridBase * | mp_oValueGrid |
Grid holding total values for each species. | |
float * | mp_fCPercentBiomass |
Percent of biomass that is carbon. | |
char * | m_cQuery |
String to pass to clTreePopulation::Find() in order to get the trees for which to calculate volume. | |
short int ** | mp_iBiomassCodes |
Holds data member codes for "Biomass" float data member (registered by the clDimensionAnalysis class). | |
short int * | mp_iValueCodes |
Holds data member codes for the "value_x" float data members of the "Carbon Value" grid. | |
short int * | mp_iCarbonCodes |
Holds data member codes for the "carbon_x" float data members of the "Carbon Value" grid. | |
float | m_fPricePerTonCarbon |
Price per metric ton of carbon - currency unimportant. | |
short int | m_iNumTotalSpecies |
Total number of species. |
This behavior calculates carbon value per species. The amount of carbon is given by the user as a percent of biomass for each species. This behavior expects the Dimension Analysis behavior (clDimensionAnalysis) to calculate tree biomass.
The user also supplies a price per metric ton of carbon. This is multipled by the amount of carbon and added up into a total value of carbon per species. The species carbon totals and carbon value totals are stored in a grid called "Carbon Value".
This class's namestring and parameter call string are both "Carbon Value Calculator".
This behavior may not be applied to seedlings.
Edit history:
-----------------
March 14, 2006 - Created (LEM)
|
Constructor.
|
|
Destructor. Deletes arrays. |
|
Makes value calculations. First, the values in the "Carbon Value" grid are cleared. Then a query is sent to the tree population to get all trees to which this behavior is applied. For each, the amount of biomass (in metric tons) is retrieved, and the carbon amount and value calculated. Then the species values are totaled and placed in the "Carbon Value" grid. Reimplemented from clBehaviorBase. |
|
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.
|
|
Retrieves the "Biomass" float data member. The return codes are captured in the mp_iBiomassCodes array.
|
|
Does setup for this behavior. Calls:
Implements clWorkerBase. |
|
Reads values from the parameter file.
|
|
Sets up the "Carbon Value" grid. This ignores any maps. |
|
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. |
|
Total number of species. For the destructor. |
|
Percent of biomass that is carbon. In the parameter file, this is as a percentage between 0 and 100. We convert this upon reading to a proportion between 0 and 1. Array size is # total species. |
|
Holds data member codes for "Biomass" float data member (registered by the clDimensionAnalysis class). First array index is total # species, second is number types (3 - sapling, adult, snag) |
|
Holds data member codes for the "carbon_x" float data members of the "Carbon Value" grid. Array size is total # species. |
|
Holds data member codes for the "value_x" float data members of the "Carbon Value" grid. Array size is total # species. |
|
Grid holding total values for each species. The grid name is "Carbon Value". The grid contains only 1 grid cell. It has 2 times X float data members, where X = the total number of species. The data member names are "carbon_x" (where "x" is the species number) for amount of carbon, and "value_x" for value of carbon. |