GCBM
Public Member Functions | Private Member Functions | Private Attributes | List of all members
SmallTreeGrowthCurve Class Reference

#include <smalltreegrowthcurve.h>

Collaboration diagram for SmallTreeGrowthCurve:
Collaboration graph

Public Member Functions

 SmallTreeGrowthCurve ()
 
virtual ~SmallTreeGrowthCurve ()
 
 SmallTreeGrowthCurve (SpeciesType speciesType)
 
std::string getEcoBoundary () const
 
SpeciesType speciesType () const
 
void checkUpdateEcoParameters (std::string ecoBoundaryName, const DynamicObject &data)
 
std::unordered_map< std::string, double > getSmallTreeBiomassCarbonIncrements (double stem, double other, double foliage, double coarseRoot, double fineRoot, int age)
 
double getStemwoodVolumeAtAge (int age)
 
double getStemwoodBiomass (double stemwoodVolume)
 
double getBiomassPercentage (COMPONENT component, double totalStemVolume)
 
void setRootBiomassEquation ()
 
void generateOrUpdateCarbonCurve ()
 

Private Member Functions

void setParametersValue (const DynamicObject &data)
 
void initilizeVectors ()
 
double commonDivider (double volume)
 
std::unordered_map< std::string, double > getAGIncrements (double stem, double other, double foliage, int age)
 

Private Attributes

int maxAge {200}
 
double a_bio {0.0}
 
double b_bio {0.0}
 
double a1 {0.0}
 
double a2 {0.0}
 
double a3 {0.0}
 
double b1 {0.0}
 
double b2 {0.0}
 
double b3 {0.0}
 
double c1 {0.0}
 
double c2 {0.0}
 
double c3 {0.0}
 
double a_vol {0.0}
 
double b_vol {0.0}
 
double vol_max { 0.0 }
 
double vol_min { 0.0 }
 
double p_sw_min { 0.0 }
 
double p_sw_max { 0.0 }
 
double p_fl_min { 0.0 }
 
double p_fl_max { 0.0 }
 
double p_br_min { 0.0 }
 
double p_br_max { 0.0 }
 
double p_sb_min { 0.0 }
 
double p_sb_max { 0.0 }
 
double sw_a { 0.0 }
 
double hw_a { 0.0 }
 
double hw_b { 0.0 }
 
double frp_a { 0.0 }
 
double frp_b { 0.0 }
 
double frp_c { 0.0 }
 
std::string ecoBoundaryName
 
SpeciesType typeName
 
std::vector< double > stemCarbonIncrements
 
std::vector< double > foliageCarbonIncrements
 
std::vector< double > otherCarbonIncrements
 
std::shared_ptr< cbm::RootBiomassEquationrootBiomassEquation
 

Constructor & Destructor Documentation

◆ SmallTreeGrowthCurve() [1/2]

◆ ~SmallTreeGrowthCurve()

virtual ~SmallTreeGrowthCurve ( )
virtual

◆ SmallTreeGrowthCurve() [2/2]

SmallTreeGrowthCurve ( SpeciesType  speciesTypeName)

Constructor

Assign SmallTreeGrowthCurve.typeName as parameter speciesTypeName

Parameters
speciesTypeNameSpeciesType

Member Function Documentation

◆ checkUpdateEcoParameters()

void checkUpdateEcoParameters ( std::string  ecoZoneName,
const DynamicObject &  data 
)

If the eco boundary is empty, SmallTreeGrowthCurve.ecoBoundaryName is empty, or value of SmallTreeGrowthCurve.ecoBoundaryName != parameter ecoZoneName, set SmallTreeGrowthCurve.ecoBoundaryName to parameter ecoZoneName
Invoke SmallTreeGrowthCurve.setParametersValue() with argument as parameter data, SmallTreeGrowthCurve.setRootBiomassEquation(), SmallTreeGrowthCurve.initilizeVectors() and SmallTreeGrowthCurve.generateOrUpdateCarbonCurve()

Parameters
ecoZoneNamestring
dataconst DynamicObject&
Returns
void

◆ commonDivider()

double commonDivider ( double  volume)
private

Return 1 + e ^ (SmallTreeGrowthCurve.a1 + SmallTreeGrowthCurve.a2 * volume + SmallTreeGrowthCurve.a3 * log(volume + 5))

Parameters
volumedouble
Returns
double

◆ generateOrUpdateCarbonCurve()

void generateOrUpdateCarbonCurve ( )

◆ getAGIncrements()

std::unordered_map< std::string, double > getAGIncrements ( double  stem,
double  other,
double  foliage,
int  age 
)
private

Get the above ground increments for the given age

If parameter age > maxAge, i.e age > 200, return an unordered map with keys "stemwood", "other", "foilage" with values 0.0, 0.0, 0.0
Else return an unordered map with key as "stemwood", value as maximum of parameter age in SmallTreeGrowthCurve.stemCarbonIncrements, -1 * stem, key as "other", value as maximum of parameter age in SmallTreeGrowthCurve.otherCarbonIncrements, -1 * other, and key as "foliage", value as maximum of parameter age in SmallTreeGrowthCurve.foliageCarbonIncrements, -1 * foliage

Parameters
stemdouble
otherdouble
foliagedouble
ageint
Returns
unordered_map<string, double>

◆ getBiomassPercentage()

double getBiomassPercentage ( COMPONENT  component,
double  stemVolume 
)

Get the biomass percentage based on the component and stemVolume

If parameter stemVolume < SmallTreeGrowthCurve.vol_min, if parameter component is : COMPONENT::BARK, return SmallTreeGrowthCurve.p_sb_min
COMPONENT::BRANCH, return SmallTreeGrowthCurve.p_br_min
COMPONENT::FOLIAGE, return SmallTreeGrowthCurve.p_fl_min
COMPONENT::STEMWOOD, return SmallTreeGrowthCurve.p_sw_min
Else if parameter stemVolume > SmallTreeGrowthCurve.vol_min, if parameter component is : COMPONENT::BARK, return SmallTreeGrowthCurve.p_sb_max
COMPONENT::BRANCH, return SmallTreeGrowthCurve.p_br_max
COMPONENT::FOLIAGE, return SmallTreeGrowthCurve.p_fl_max
COMPONENT::STEMWOOD, return SmallTreeGrowthCurve.p_sw_max
Else if parameter stemVolume == SmallTreeGrowthCurve.vol_min, if parameter component is : COMPONENT::BARK, return e ^ (SmallTreeGrowthCurve.a1 + SmallTreeGrowthCurve.a2 * stemVolume + SmallTreeGrowthCurve.a3 * log(stemVolume + 5)) / SmallTreeGrowthCurve.commonDivider(), with argument stemVolume
COMPONENT::BRANCH, return e ^ (SmallTreeGrowthCurve.b1 + SmallTreeGrowthCurve.b2 * stemVolume + SmallTreeGrowthCurve.b3 * log(stemVolume + 5)) / commonDivider(), with argument stemVolume
COMPONENT::FOILAGE, return e ^ (SmallTreeGrowthCurve.c1 + SmallTreeGrowthCurve.c2 * stemVolume + SmallTreeGrowthCurve.c3 * log(stemVolume + 5)) / commonDivider(), with argument stemVolume
COMPONENT::STEMWOOD, return 1 / SmallTreeGrowthCurve.commonDivider(), with argument stemVolume

Parameters
componentCOMPONENT
stemwoodVolumedouble
Returns
double

◆ getEcoBoundary()

std::string getEcoBoundary ( ) const

◆ getSmallTreeBiomassCarbonIncrements()

std::unordered_map< std::string, double > getSmallTreeBiomassCarbonIncrements ( double  stem,
double  other,
double  foliage,
double  coarseRoot,
double  fineRoot,
int  age 
)

Get the value of variable agIncrements as the result of SmallTreeGrowthCurve.getAGIncrements() with arguments as parameters stem, other, foliage and age
Calculate the values of variables totalAGCarbon, the total above ground biomass carbon totalBGBiomass, the total below ground biomass biomass and totalBiomass, rootProps and rootCarbon, the total root biomassCarbon
Return an unordered_map with the key "stemwood", value as "stemwood" in agIncrements, key "other", value as "other" in agIncrements, key "foliage", value as "foliage" in agIncrements, key "coarseRoot", value as rootCarbon * rootProps.coarse - coarseRoot and key "fineRoot", with value rootCarbon * rootProps.fine - fineRoot

Parameters
stemdouble
otherdouble
foliagedouble
ageint
rootCarbondouble
rootPropsRootProperties
coarseRootdouble
fineRootdouble
Returns
unordered_map<string, double>

◆ getStemwoodBiomass()

double getStemwoodBiomass ( double  stemwoodVolume)

Return SmallTreeGrowthCurve.a_bio * pow(stemwoodVolume, SmallTreeGrowthCurve.b_bio)

Parameters
stemwoodVolumedouble
Returns
double

◆ getStemwoodVolumeAtAge()

double getStemwoodVolumeAtAge ( int  age)

Return SmallTreeGrowthCurve.a_vol * pow(age, SmallTreeGrowthCurve.qb_vol) * (e ^ (-1 * SmallTreeGrowthCurve.a_vol * age))

Parameters
stemwoodVolumedouble
Returns
double

◆ initilizeVectors()

void initilizeVectors ( )
private

◆ setParametersValue()

void setParametersValue ( const DynamicObject &  data)
private

◆ setRootBiomassEquation()

void setRootBiomassEquation ( )

◆ speciesType()

SpeciesType speciesType ( ) const

Return SmallTreeGrowthCurve.typeName

Returns
SpeciesType

Member Data Documentation

◆ a1

double a1 {0.0}
private

◆ a2

double a2 {0.0}
private

◆ a3

double a3 {0.0}
private

◆ a_bio

double a_bio {0.0}
private

◆ a_vol

double a_vol {0.0}
private

◆ b1

double b1 {0.0}
private

◆ b2

double b2 {0.0}
private

◆ b3

double b3 {0.0}
private

◆ b_bio

double b_bio {0.0}
private

◆ b_vol

double b_vol {0.0}
private

◆ c1

double c1 {0.0}
private

◆ c2

double c2 {0.0}
private

◆ c3

double c3 {0.0}
private

◆ ecoBoundaryName

std::string ecoBoundaryName
private

◆ foliageCarbonIncrements

std::vector<double> foliageCarbonIncrements
private

◆ frp_a

double frp_a { 0.0 }
private

◆ frp_b

double frp_b { 0.0 }
private

◆ frp_c

double frp_c { 0.0 }
private

◆ hw_a

double hw_a { 0.0 }
private

◆ hw_b

double hw_b { 0.0 }
private

◆ maxAge

int maxAge {200}
private

◆ otherCarbonIncrements

std::vector<double> otherCarbonIncrements
private

◆ p_br_max

double p_br_max { 0.0 }
private

◆ p_br_min

double p_br_min { 0.0 }
private

◆ p_fl_max

double p_fl_max { 0.0 }
private

◆ p_fl_min

double p_fl_min { 0.0 }
private

◆ p_sb_max

double p_sb_max { 0.0 }
private

◆ p_sb_min

double p_sb_min { 0.0 }
private

◆ p_sw_max

double p_sw_max { 0.0 }
private

◆ p_sw_min

double p_sw_min { 0.0 }
private

◆ rootBiomassEquation

std::shared_ptr<cbm::RootBiomassEquation> rootBiomassEquation
private

◆ stemCarbonIncrements

std::vector<double> stemCarbonIncrements
private

◆ sw_a

double sw_a { 0.0 }
private

◆ typeName

SpeciesType typeName
private

◆ vol_max

double vol_max { 0.0 }
private

◆ vol_min

double vol_min { 0.0 }
private

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