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

#include <standcomponent.h>

Collaboration diagram for StandComponent:
Collaboration graph

Public Member Functions

 StandComponent (std::string forestType, std::shared_ptr< RootBiomassEquation > rootBiomassEquation, std::shared_ptr< ComponentBiomassCarbonCurve > growthCurve)
 
virtual ~StandComponent ()=default
 
virtual const std::string & forestType () const
 
virtual double calculateRootBiomass (flint::ILandUnitDataWrapper *landUnitData) const
 
virtual std::unordered_map< std::string, double > getIncrements (flint::ILandUnitDataWrapper *landUnitData, double standRootBiomass) const
 
virtual std::vector< double > getAboveGroundCarbonCurve () const
 
virtual const std::vector< double > & getMerchCarbonCurve () const
 
virtual const std::vector< double > & getFoliageCarbonCurve () const
 
virtual const std::vector< double > & getOtherCarbonCurve () const
 

Private Member Functions

std::unordered_map< std::string, double > getAGIncrements (const flint::IVariable *age, const flint::IPool *merch, const flint::IPool *other, const flint::IPool *foliage) const
 

Private Attributes

std::string _forestType
 
std::shared_ptr< RootBiomassEquation_rootBiomassEquation
 
std::shared_ptr< ComponentBiomassCarbonCurve_growthCurve
 

Constructor & Destructor Documentation

◆ StandComponent()

StandComponent ( std::string  forestType,
std::shared_ptr< RootBiomassEquation rootBiomassEquation,
std::shared_ptr< ComponentBiomassCarbonCurve growthCurve 
)

◆ ~StandComponent()

virtual ~StandComponent ( )
virtualdefault

Member Function Documentation

◆ calculateRootBiomass()

double calculateRootBiomass ( flint::ILandUnitDataWrapper *  landUnitData) const
virtual

Calculate the total above ground biomass from merchantable, foilage and other sources and return the root biomass

Assign variable age as value of variable "age" in parameter landUnitData,
merch as value of pool StandComponent._forestType + "Merch", other as value of pool StandComponent._forestType + "Other" and foilage as value of pool StandComponent._forestType + "Foilage" in parameter landUnitData
Assign the above ground biomass increments to variable agIncrements, the result of StandComponent.getAGIncrements() with arguments age, merch, other, foilage
The totalAGBiomass is given as the sum of values merch, other, foilage and the values of the name of merch, other and foilage in agIncrements Return the result of RootBiomassEquation.calculateRootBiomass() with argument totalAGBiomass on StandComponent._rootBiomassEquation

Parameters
landUnitDataflint::ILandUnitDataWrapper*
Returns
double

◆ forestType()

virtual const std::string& forestType ( ) const
virtual

◆ getAboveGroundCarbonCurve()

std::vector< double > getAboveGroundCarbonCurve ( ) const
virtual

◆ getAGIncrements()

std::unordered_map< std::string, double > getAGIncrements ( const flint::IVariable *  age,
const flint::IPool *  merch,
const flint::IPool *  other,
const flint::IPool *  foliage 
) const
private

Return either the increment or the remainder of the pool values merchantable, foilage and other, if the increment results in a negative pool value

Assign variables ageValue, merchValue, otherValue, foilageValue the values of parameters age, merch, other and foilage
Return an unordered map with key as name of merch, value as the maximum of StandComponent.getMerchCarbonIncrement() on StandComponent._growthCurve with parameter ageValue and the -1 * merchValue,
name of other, value as the maximum of StandComponent.getMerchCarbonIncrement() on StandComponent._growthCurve with parameter ageValue and the -1 * otherValue,
name of foilage, value as the maximum of StandComponent.getMerchCarbonIncrement() on StandComponent._growthCurve with parameter ageValue and the -1 * foilageValue

Parameters
ageconst flint::IVariable*
merchconst flint::IPool*
otherconst flint::IPool*
Returns
unordered_map<std::string, double>

◆ getFoliageCarbonCurve()

const std::vector< double > & getFoliageCarbonCurve ( ) const
virtual

◆ getIncrements()

std::unordered_map< std::string, double > getIncrements ( flint::ILandUnitDataWrapper *  landUnitData,
double  standRootBiomass 
) const
virtual

Assign the values of pools "Merch", "Other", "Foilage", "CoarseRoots" and "FineRoots" in parameter landUnitData to variables merch, other, foliage, coarseRoots and fineRoots
Invoke StandComponent.getAGIncrements() with parameters as value of variable "age" in _landUnitData and pools march, other and foilage to calculate the above ground biomass incrementsm, set it to variable agIncrements
Assign the result of RootBiomassEquation.biomassToCarbon() on StandComponent._rootBiomassEquation with argument as the result of StandComponent.calculateRootBiomass() to variable rootCarbon,
the result of RootBiomassEquation.calculateRootProportions on StandComponent._rootBiomassEquation with argument as paramter standRootBiomass to variable rootProportions
Return an unordered map with key name of merch pool, value of merch in agIncrements
key name of other pool, value of other in agIncrements name of foilage pool, value of foilage in agIncrements
key name of fineRoots pool, value rootCarbon * rootProportions.fine - fineRoots, and key name of coarseRoots pool and value rootCarbon * rootProportions.coarse - coarseRoots

Parameters
landUnitDataflint::ILandUnitDataWrapper*
standRootBiomassdouble
Returns
unordered_map<std::string, double>

◆ getMerchCarbonCurve()

const std::vector< double > & getMerchCarbonCurve ( ) const
virtual

◆ getOtherCarbonCurve()

const std::vector< double > & getOtherCarbonCurve ( ) const
virtual

Member Data Documentation

◆ _forestType

std::string _forestType
private

◆ _growthCurve

std::shared_ptr<ComponentBiomassCarbonCurve> _growthCurve
private

◆ _rootBiomassEquation

std::shared_ptr<RootBiomassEquation> _rootBiomassEquation
private

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