GCBM
cbmlandclasstransitionmodule.h
Go to the documentation of this file.
1 #ifndef MOJA_MODULES_CBM_CBMLANDCLASSTRANSITIONMODULE_H_
2 #define MOJA_MODULES_CBM_CBMLANDCLASSTRANSITIONMODULE_H_
3 
5 #include "moja/hash.h"
6 #include <unordered_map>
7 
8 namespace moja {
9 namespace modules {
10 namespace cbm {
11 
13  public:
15  virtual ~CBMLandClassTransitionModule() = default;
16 
17  void configure(const DynamicObject& config) override;
18  void subscribe(NotificationCenter& notificationCenter) override;
19 
20  flint::ModuleTypes moduleType() { return flint::ModuleTypes::Model; };
21 
22  virtual void doLocalDomainInit() override;
23  virtual void doTimingInit() override;
24  virtual void doTimingStep() override;
25 
26  private:
27  flint::IVariable* _historicLandClass;
28  flint::IVariable* _currentLandClass;
29  flint::IVariable* _unfcccLandClass;
30  flint::IVariable* _isForest;
31  flint::IVariable* _lastPassDisturbance;
32  flint::IVariable* _isDecaying;
33  flint::IVariable* _lastPassDisturbanceTimeseries = nullptr;
34 
35  std::unordered_map<std::string, bool> _landClassForestStatus;
36  std::unordered_map<std::string, int> _landClassElapsedTime;
37  std::unordered_map<std::string, std::string> _landClassTransitions;
38  std::string _lastCurrentLandClass;
40 
41  void updateRemainingStatus(std::string landClass);
42  void setUnfcccLandClass();
44  std::string getCreationDisturbance();
45  };
46 
47 }}} // namespace moja::modules::cbm
48 #endif // MOJA_MODULES_CBM_CBMLANDCLASSTRANSITIONMODULE_H_
moja::modules::cbm
Definition: ageclasshelper.cpp:12
moja::modules::cbm::CBMLandClassTransitionModule
Definition: cbmlandclasstransitionmodule.h:12
moja::modules::cbm::CBMLandClassTransitionModule::_landClassTransitions
std::unordered_map< std::string, std::string > _landClassTransitions
Definition: cbmlandclasstransitionmodule.h:37
moja::modules::cbm::CBMModuleBase
Definition: cbmmodulebase.h:22
moja::modules::cbm::CBMLandClassTransitionModule::doTimingInit
virtual void doTimingInit() override
Definition: cbmlandclasstransitionmodule.cpp:99
moja::modules::cbm::CBMLandClassTransitionModule::fetchLandClassTransitions
void fetchLandClassTransitions()
Definition: cbmlandclasstransitionmodule.cpp:195
moja::modules::cbm::CBMLandClassTransitionModule::_landClassElapsedTime
std::unordered_map< std::string, int > _landClassElapsedTime
Definition: cbmlandclasstransitionmodule.h:36
moja::modules::cbm::CBMLandClassTransitionModule::_currentLandClass
flint::IVariable * _currentLandClass
Definition: cbmlandclasstransitionmodule.h:28
moja::modules::cbm::CBMLandClassTransitionModule::CBMLandClassTransitionModule
CBMLandClassTransitionModule()
Definition: cbmlandclasstransitionmodule.h:14
moja::modules::cbm::CBMLandClassTransitionModule::~CBMLandClassTransitionModule
virtual ~CBMLandClassTransitionModule()=default
moja::modules::cbm::CBMLandClassTransitionModule::_unfcccLandClass
flint::IVariable * _unfcccLandClass
Definition: cbmlandclasstransitionmodule.h:29
moja::modules::cbm::CBMLandClassTransitionModule::_lastPassDisturbanceTimeseries
flint::IVariable * _lastPassDisturbanceTimeseries
Definition: cbmlandclasstransitionmodule.h:33
moja::modules::cbm::CBMLandClassTransitionModule::moduleType
flint::ModuleTypes moduleType()
Definition: cbmlandclasstransitionmodule.h:20
moja::modules::cbm::CBMLandClassTransitionModule::configure
void configure(const DynamicObject &config) override
Definition: cbmlandclasstransitionmodule.cpp:28
moja::modules::cbm::CBMLandClassTransitionModule::updateRemainingStatus
void updateRemainingStatus(std::string landClass)
Definition: cbmlandclasstransitionmodule.cpp:218
moja::modules::cbm::CBMLandClassTransitionModule::doLocalDomainInit
virtual void doLocalDomainInit() override
Definition: cbmlandclasstransitionmodule.cpp:58
moja::modules::cbm::CBMLandClassTransitionModule::subscribe
void subscribe(NotificationCenter &notificationCenter) override
Definition: cbmlandclasstransitionmodule.cpp:36
moja::modules::cbm::CBMLandClassTransitionModule::setUnfcccLandClass
void setUnfcccLandClass()
Definition: cbmlandclasstransitionmodule.cpp:240
moja::modules::cbm::CBMLandClassTransitionModule::getCreationDisturbance
std::string getCreationDisturbance()
Definition: cbmlandclasstransitionmodule.cpp:163
moja::modules::cbm::CBMLandClassTransitionModule::_historicLandClass
flint::IVariable * _historicLandClass
Definition: cbmlandclasstransitionmodule.h:27
moja::modules::cbm::CBMLandClassTransitionModule::_isDecaying
flint::IVariable * _isDecaying
Definition: cbmlandclasstransitionmodule.h:32
moja::modules::cbm::CBMLandClassTransitionModule::_landClassForestStatus
std::unordered_map< std::string, bool > _landClassForestStatus
Definition: cbmlandclasstransitionmodule.h:35
moja::modules::cbm::CBMLandClassTransitionModule::doTimingStep
virtual void doTimingStep() override
Definition: cbmlandclasstransitionmodule.cpp:134
moja
Definition: ageclasshelper.cpp:10
moja::modules::cbm::CBMLandClassTransitionModule::_lastCurrentLandClass
std::string _lastCurrentLandClass
Definition: cbmlandclasstransitionmodule.h:38
cbmmodulebase.h
moja::modules::cbm::CBMLandClassTransitionModule::_isForest
flint::IVariable * _isForest
Definition: cbmlandclasstransitionmodule.h:30
moja::modules::cbm::CBMLandClassTransitionModule::_lastPassDisturbance
flint::IVariable * _lastPassDisturbance
Definition: cbmlandclasstransitionmodule.h:31
moja::modules::cbm::CBMLandClassTransitionModule::_yearsSinceTransition
int _yearsSinceTransition
Definition: cbmlandclasstransitionmodule.h:39