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

#include <standbiomasscarboncurve.h>

Collaboration diagram for StandBiomassCarbonCurve:
Collaboration graph

Public Member Functions

 StandBiomassCarbonCurve ()
 
virtual ~StandBiomassCarbonCurve ()
 
void addComponent (const StandComponent &component)
 
std::unordered_map< std::string, double > getIncrements (flint::ILandUnitDataWrapper *landUnitData)
 
std::vector< double > getAboveGroundCarbonCurve ()
 
std::vector< double > getMerchCarbonCurve ()
 
std::vector< double > getFoliageCarbonCurve ()
 
std::vector< double > getOtherCarbonCurve ()
 
void writeDebuggingInfo (const std::string &path)
 

Private Attributes

std::vector< StandComponent_components
 

Constructor & Destructor Documentation

◆ StandBiomassCarbonCurve()

◆ ~StandBiomassCarbonCurve()

virtual ~StandBiomassCarbonCurve ( )
virtual

Member Function Documentation

◆ addComponent()

void addComponent ( const StandComponent component)

◆ getAboveGroundCarbonCurve()

std::vector< double > getAboveGroundCarbonCurve ( )

Get the absolute total aboveground carbon at each age, where index = age

Create a vector variable, curve, to store the absolute total aboveground carbon at each age
For each component in StandBiomassCarbonCurve._components, invoke StandComponent.getAboveGroundCarbonCurve() and assign it to variable componentCurve
If the size of componentCurve > size of curve, resize variable curve to the size of componentCurve, initialise the new indices in curve to 0.0
For each index in range 0 to the size of componentCurve, add the value of componentCurve at that index to the value at the same index in variable curve
Return variable curve

Returns
vector<double>

◆ getFoliageCarbonCurve()

std::vector< double > getFoliageCarbonCurve ( )

Get the absolute total foliage carbon at each age, where index = age

Create a vector variable, curve, to store the absolute total foliage carbon at each age
For each component in StandBiomassCarbonCurve._components, invoke StandComponent.getFoliageCarbonCurve() and assign it to variable componentCurve
If the size of componentCurve > size of curve, resize variable curve to the size of componentCurve, initialise the new indices in curve to 0.0
For each index in range 0 to the size of componentCurve, add the value of componentCurve at that index to the value at the same index in variable curve
Return variable curve

Returns
vector<double>

◆ getIncrements()

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

Create a variable standRootBiomass with initial value 0.0
Add to standRootBiomass the result of StandComponent.calculateRootBiomass() on each component in StandBiomassCarbonCurve._components
Create an unoredered_map<string::double> variable increments
For each component in StandBiomassCarbonCurve._components, add the result of StandComponent.getIncrements() with arguments as parameter landUnitData and variable standRootBiomass to variable increments
Return increments

Parameters
landUnitDataflint::ILandUnitDataWrapper*
Returns
nordered_map<string, double>

◆ getMerchCarbonCurve()

std::vector< double > getMerchCarbonCurve ( )

Get the absolute total merchantable carbon at each age, where index = age

Create a vector variable, curve, to store the absolute total merchantable carbon at each age
For each component in StandBiomassCarbonCurve._components, invoke StandComponent.getMerchCarbonCurve() and assign it to variable componentCurve
If the size of componentCurve > size of curve, resize variable curve to the size of componentCurve, initialise the new indices in curve to 0.0
For each index in range 0 to the size of componentCurve, add the value of componentCurve at that index to the value at the same index in variable curve
Return variable curve

Returns
vector<double>

◆ getOtherCarbonCurve()

std::vector< double > getOtherCarbonCurve ( )

Get the absolute total other carbon at each age, where index = age

Create a vector variable, curve, to store the absolute total other carbon at each age
For each component in StandBiomassCarbonCurve._components, invoke StandComponent.getOtherCarbonCurve() and assign it to variable componentCurve
If the size of componentCurve > size of curve, resize variable curve to the size of componentCurve, initialise the new indices in curve to 0.0
For each index in range 0 to the size of componentCurve, add the value of componentCurve at that index to the value at the same index in variable curve
Return variable curve

Returns
vector<double>

◆ writeDebuggingInfo()

void writeDebuggingInfo ( const std::string &  path)

Write the results of StandBiomassCarbonCurve.getMerchCarbonCurve(), StandBiomassCarbonCurve.getFoliageCarbonCurve(), and StandBiomassCarbonCurve.getOtherCarbonCurve() to a file, parameter path is the output file path

Parameters
pathstring&
Returns
void

Member Data Documentation

◆ _components

std::vector<StandComponent> _components
private

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