GCBM
standcomponent.h
Go to the documentation of this file.
1 #ifndef MOJA_MODULES_CBM_STANDCOMPONENT_H_
2 #define MOJA_MODULES_CBM_STANDCOMPONENT_H_
3 
4 #include "moja/modules/cbm/_modules.cbm_exports.h"
7 
8 #include "moja/flint/ipool.h"
9 #include "moja/flint/modulebase.h"
10 
11 #include <unordered_map>
12 
13 namespace moja {
14 namespace modules {
15 namespace cbm {
16 
17  class CBM_API StandComponent {
18  public:
19  StandComponent(std::string forestType,
20  std::shared_ptr<RootBiomassEquation> rootBiomassEquation,
21  std::shared_ptr<ComponentBiomassCarbonCurve> growthCurve)
22  : _forestType(forestType), _growthCurve(growthCurve) {
23 
24  _rootBiomassEquation = rootBiomassEquation;
25  }
26 
27  virtual ~StandComponent() = default;
28 
29  virtual const std::string& forestType() const { return _forestType; }
30 
31  virtual double calculateRootBiomass(flint::ILandUnitDataWrapper* landUnitData) const;
32  virtual std::unordered_map<std::string, double> getIncrements(flint::ILandUnitDataWrapper* landUnitData, double standRootBiomass) const;
33  virtual std::vector<double> getAboveGroundCarbonCurve() const;
34 
35  virtual const std::vector<double>& getMerchCarbonCurve() const;
36  virtual const std::vector<double>& getFoliageCarbonCurve() const;
37  virtual const std::vector<double>& getOtherCarbonCurve() const;
38 
39  private:
40  std::string _forestType;
41  std::shared_ptr<RootBiomassEquation> _rootBiomassEquation;
42  std::shared_ptr<ComponentBiomassCarbonCurve> _growthCurve;
43 
44  std::unordered_map<std::string, double> getAGIncrements(
45  const flint::IVariable* age, const flint::IPool* merch, const flint::IPool* other,
46  const flint::IPool* foliage) const;
47  };
48 
49 }}}
50 #endif
componentbiomasscarboncurve.h
moja::modules::cbm
Definition: ageclasshelper.cpp:12
moja::modules::cbm::StandComponent::_growthCurve
std::shared_ptr< ComponentBiomassCarbonCurve > _growthCurve
Definition: standcomponent.h:42
moja::modules::cbm::StandComponent::StandComponent
StandComponent(std::string forestType, std::shared_ptr< RootBiomassEquation > rootBiomassEquation, std::shared_ptr< ComponentBiomassCarbonCurve > growthCurve)
Definition: standcomponent.h:19
moja::modules::cbm::StandComponent::forestType
virtual const std::string & forestType() const
Definition: standcomponent.h:29
moja::modules::cbm::StandComponent::_rootBiomassEquation
std::shared_ptr< RootBiomassEquation > _rootBiomassEquation
Definition: standcomponent.h:41
moja::modules::cbm::StandComponent
Definition: standcomponent.h:17
moja::modules::cbm::StandComponent::_forestType
std::string _forestType
Definition: standcomponent.h:40
moja
Definition: ageclasshelper.cpp:10
rootbiomassequation.h