Go to the documentation of this file. 1 #ifndef MOJA_MODULES_CBM_ESGYMSPINUPSEQUENCER_H_
2 #define MOJA_MODULES_CBM_ESGYMSPINUPSEQUENCER_H_
4 #include <unordered_map>
6 #include "moja/modules/cbm/_modules.cbm_exports.h"
7 #include "moja/datetime.h"
8 #include "moja/flint/itiming.h"
9 #include "moja/flint/sequencermodulebase.h"
10 #include "moja/notificationcenter.h"
11 #include "moja/pocojsonutils.h"
22 const std::string returnInverval =
"return_interval";
23 const std::string maxRotation =
"max_rotations";
24 const std::string historicDistType =
"historic_disturbance_type";
25 const std::string lastDistType =
"last_pass_disturbance_type";
26 const std::string delay =
"delay";
27 const std::string inventoryDelay =
"inventory_delay";
29 void configure(
const DynamicObject& config)
override {
30 if (config.contains(
"ramp_start_date")) {
31 _rampStartDate = moja::parseSimpleDate(
32 config[
"ramp_start_date"].extract<std::string>());
40 startDate = timing.startDate();
41 endDate = timing.endDate();
44 bool Run(NotificationCenter& _notificationCenter, flint::ILandUnitController& luc)
override;
56 bool getSpinupParameters(flint::ILandUnitDataWrapper& landUnitData);
59 bool isSlowPoolStable(
double lastSlowPoolValue,
double currentSlowPoolValue);
62 void fireSpinupSequenceEvent(NotificationCenter& notificationCenter,
63 flint::ILandUnitController& luc,
68 void fireHistoricalLastDisturbanceEvent(NotificationCenter& notificationCenter,
69 flint::ILandUnitController& luc,
70 std::string disturbanceName);
72 void fetchDistTypeCodes();
std::unordered_map< std::string, int > _distTypeCodes
Definition: esgymspinupsequencer.h:123
std::string _lastPassDistType
Last disturance type happened when the slow pool is stable and minimum rotations are done
Definition: esgymspinupsequencer.h:112
Definition: ageclasshelper.cpp:12
int _standDelay
Years to delay, during delay period, only turnover and decay processes
Definition: esgymspinupsequencer.h:97
int _standAge
Stand age to grow after the last disturbance
Definition: esgymspinupsequencer.h:92
flint::IVariable * _age
Definition: esgymspinupsequencer.h:52
const flint::IPool * _belowGroundSlowSoil
Definition: esgymspinupsequencer.h:51
DateTime endDate
Definition: esgymspinupsequencer.h:48
int _maxRotationValue
Maximum rotations to do the spinup, 30, each rotation is 125 years
Definition: esgymspinupsequencer.h:77
Poco::Nullable< DateTime > _rampStartDate
Last disturance type happened when the slow pool is stable and minimum rotations are done Optional ra...
Definition: esgymspinupsequencer.h:121
const flint::IPool * _aboveGroundSlowSoil
Definition: esgymspinupsequencer.h:50
ESGYMSpinupSequencer()
Definition: esgymspinupsequencer.h:19
DateTime startDate
Definition: esgymspinupsequencer.h:47
flint::IVariable * _delay
Definition: esgymspinupsequencer.h:53
void configure(flint::ITiming &timing) override
Set the value of startDate and endDate from parameter timing
Definition: esgymspinupsequencer.h:39
virtual ~ESGYMSpinupSequencer()
Definition: esgymspinupsequencer.h:20
int _ageReturnInterval
Age interval to fire a historic disturbance, 125 years
Definition: esgymspinupsequencer.h:87
void configure(const DynamicObject &config) override
Definition: esgymspinupsequencer.h:29
Definition: esgymspinupsequencer.h:17
int _spinupGrowthCurveID
Spinup growth curve ID
Definition: esgymspinupsequencer.h:102
int _miniumRotation
Minimum rotation to do the spinup, 3
Definition: esgymspinupsequencer.h:82
Definition: ageclasshelper.cpp:10
std::string _historicDistType
Historic disturbance type happened at each age interval
Definition: esgymspinupsequencer.h:107