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

#include <volumetobiomasscarbongrowth.h>

Collaboration diagram for VolumeToBiomassCarbonGrowth:
Collaboration graph

Public Member Functions

 VolumeToBiomassCarbonGrowth (bool smootherEnabled=true)
 
virtual ~VolumeToBiomassCarbonGrowth ()
 
void generateBiomassCarbonCurve (StandGrowthCurve &standGrowthCurve)
 
std::unordered_map< std::string, double > getBiomassCarbonIncrements (flint::ILandUnitDataWrapper *landUnitData, Int64 growthCurveID, Int64 spuID)
 
std::vector< double > getAboveGroundCarbonCurve (Int64 growthCurveID, Int64 spuID)
 
std::vector< double > getFoliageCarbonCurve (Int64 growthCurveID, Int64 spuID)
 
bool isBiomassCarbonCurveAvailable (Int64 growthCurveID, Int64 spuID)
 
void setSmoothing (bool enabled)
 
Poco::SharedPtr< StandBiomassCarbonCurvegetBiomassCarbonCurve (Int64 growthCurveID, Int64 spuID)
 

Private Member Functions

VolumeToBiomassConvertergetConverter ()
 
Poco::LRUCache< std::tuple< Int64, Int64 >, StandBiomassCarbonCurve > & getCache ()
 

Constructor & Destructor Documentation

◆ VolumeToBiomassCarbonGrowth()

VolumeToBiomassCarbonGrowth ( bool  smootherEnabled = true)

◆ ~VolumeToBiomassCarbonGrowth()

virtual ~VolumeToBiomassCarbonGrowth ( )
virtual

Member Function Documentation

◆ generateBiomassCarbonCurve()

void generateBiomassCarbonCurve ( StandGrowthCurve standGrowthCurve)

Generate Biomass carbon curves

If parameter standGrowthCurve has the yield component SpeciesType::Softwood or/and SpeciesType::Hardwood, generate the component biomass carbon curve and the root biomass equation corresponding to the forest configuration using moja::modules::CBM::StandGrowthCurve.getForestTypeConfiguration()
Add the components species type, root biomass equation and carbon curve to the parameter standCarbonCurve
Add the standCarbonCurve to the cache using VolumeToBiomassCarbonGrowth.getCache() for the tuple key (StandGrowthCurve.standGrowthCurveID(), StandGrowthCurve.spuID())

Parameters
standGrowthCurveStandGrowthCurve&
Returns
void

◆ getAboveGroundCarbonCurve()

std::vector< double > getAboveGroundCarbonCurve ( Int64  growthCurveID,
Int64  spuID 
)

If the tuple parameter growthCurveId, spuId exists in VolumeToBiomassCarbonGrowth.getCache(), get the StandBiomassCarbonCurve object from cache, and return the result of VolumeToBiomassCarbonGrowth.getAboveGroundCarbonCurve()

Parameters
growthCurveIdInt64
spuIdInt64
Returns
vector<double>

◆ getBiomassCarbonCurve()

Poco::SharedPtr< StandBiomassCarbonCurve > getBiomassCarbonCurve ( Int64  growthCurveID,
Int64  spuID 
)

◆ getBiomassCarbonIncrements()

std::unordered_map< std::string, double > getBiomassCarbonIncrements ( flint::ILandUnitDataWrapper *  landUnitData,
Int64  growthCurveID,
Int64  spuID 
)

If the tuple parameter growthCurveId, spuId exists in VolumeToBiomassCarbonGrowth.getCache(), get the StandBiomassCarbonCurve object from cache, and return the result of StandBiomassCarbonCurve.getIncrements() with argument as parameter landUnitData

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

◆ getCache()

Poco::LRUCache<std::tuple<Int64, Int64>, StandBiomassCarbonCurve>& getCache ( )
private

◆ getConverter()

VolumeToBiomassConverter& getConverter ( )
private

◆ getFoliageCarbonCurve()

std::vector< double > getFoliageCarbonCurve ( Int64  growthCurveID,
Int64  spuID 
)

If the tuple parameter growthCurveId, spuId exists in VolumeToBiomassCarbonGrowth.getCache(), if the StandBiomassCarbonCurve object returned from cache is not null, return it, else return nullptr

Parameters
growthCurveIdInt64
spuIdInt64
Returns
vector<double>

◆ isBiomassCarbonCurveAvailable()

bool isBiomassCarbonCurveAvailable ( Int64  growthCurveID,
Int64  spuID 
)

Return if VolumeToBiomassCarbonGrowth.getBiomassCarbonCurve() with arguments growthCurveID, spuID is not null

Parameters
growthCurveIDInt64
spuIDInt64
Returns
bool

◆ setSmoothing()

void setSmoothing ( bool  enabled)

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