Go to the documentation of this file. 1 #ifndef MOJA_MODULES_CBM_CBMAGGREGATORLANDUNITDATA_H_
2 #define MOJA_MODULES_CBM_CBMAGGREGATORLANDUNITDATA_H_
4 #include "moja/modules/cbm/_modules.cbm_exports.h"
8 #include "moja/flint/spatiallocationinfo.h"
10 #include <Poco/Mutex.h>
16 template<
class TPersistable,
class TRecord>
17 class RecordAccumulatorWithMutex2;
34 std::shared_ptr<std::vector<std::string>> classifierNames,
35 std::shared_ptr<Poco::Mutex> classifierNamesLock,
43 _dateDimension(dateDimension),
44 _poolInfoDimension(poolInfoDimension),
45 _classifierSetDimension(classifierSetDimension),
46 _landClassDimension(landClassDimension),
47 _locationDimension(locationDimension),
48 _moduleInfoDimension(moduleInfoDimension),
49 _disturbanceTypeDimension(disturbanceTypeDimension),
50 _disturbanceDimension(disturbanceDimension),
51 _classifierNames(classifierNames),
52 _classifierNamesLock(classifierNamesLock),
53 _poolDimension(poolDimension),
54 _fluxDimension(fluxDimension),
55 _ageClassDimension(AgeClassDimension),
56 _ageAreaDimension(AgeAreaDimension),
57 _errorDimension(errorDimension),
58 _locationErrorDimension(locationErrorDimension),
60 _previousLocationId(0) {}
64 void configure(
const DynamicObject& config)
override;
65 void subscribe(NotificationCenter& notificationCenter)
override;
67 flint::ModuleTypes
moduleType()
override {
return flint::ModuleTypes::System; };
69 void doLocalDomainInit()
override;
70 void doTimingInit()
override;
71 void doOutputStep()
override;
72 void doError(std::string msg)
override;
75 std::shared_ptr<flint::RecordAccumulatorWithMutex2<DateRow, DateRecord>>
_dateDimension;
76 std::shared_ptr<flint::RecordAccumulatorWithMutex2<PoolInfoRow, PoolInfoRecord>>
_poolInfoDimension;
78 std::shared_ptr<flint::RecordAccumulatorWithMutex2<LandClassRow, LandClassRecord>>
_landClassDimension;
79 std::shared_ptr<flint::RecordAccumulatorWithMutex2<TemporalLocationRow, TemporalLocationRecord>>
_locationDimension;
81 std::shared_ptr<flint::RecordAccumulatorWithMutex2<PoolRow, PoolRecord>>
_poolDimension;
82 std::shared_ptr<flint::RecordAccumulatorWithMutex2<FluxRow, FluxRecord>>
_fluxDimension;
83 std::shared_ptr<flint::RecordAccumulatorWithMutex2<AgeClassRow, AgeClassRecord>>
_ageClassDimension;
84 std::shared_ptr<flint::RecordAccumulatorWithMutex2<AgeAreaRow, AgeAreaRecord>>
_ageAreaDimension;
87 std::shared_ptr<flint::RecordAccumulatorWithMutex2<ErrorRow, ErrorRecord>>
_errorDimension;
102 Int64 getPoolId(
const flint::IPool* pool);
103 Int64 recordLocation(
bool isSpinup);
104 void recordLandUnitData(
bool isSpinup);
105 void recordPoolsSet(Int64 locationId);
106 void recordFluxSet(Int64 locationId);
107 void recordClassifierNames(
const DynamicObject& classifierSet);
108 void recordAgeArea(Int64 locationId);
109 void recordAgeClass();
110 bool hasDisturbanceInfo(std::shared_ptr<flint::IOperationResult> flux);
115 #endif // MOJA_MODULES_CBM_CBMAGGREGATORLANDUNITDATA_H_
AgeClassHelper _ageClassHelper
Definition: cbmaggregatorlandunitdata.h:100
std::shared_ptr< flint::RecordAccumulatorWithMutex2< AgeClassRow, AgeClassRecord > > _ageClassDimension
Definition: cbmaggregatorlandunitdata.h:83
std::shared_ptr< const flint::SpatialLocationInfo > _spatialLocationInfo
Definition: cbmaggregatorlandunitdata.h:95
Definition: ageclasshelper.cpp:12
std::shared_ptr< flint::RecordAccumulatorWithMutex2< DisturbanceRow, DisturbanceRecord > > _disturbanceDimension
Definition: cbmaggregatorlandunitdata.h:86
flint::ModuleTypes moduleType() override
Definition: cbmaggregatorlandunitdata.h:67
std::shared_ptr< flint::RecordAccumulatorWithMutex2< TemporalLocationRow, TemporalLocationRecord > > _locationDimension
Definition: cbmaggregatorlandunitdata.h:79
Definition: cbmaggregatorcsvwriter.h:21
std::shared_ptr< flint::RecordAccumulatorWithMutex2< ErrorRow, ErrorRecord > > _errorDimension
Definition: cbmaggregatorlandunitdata.h:87
Definition: cbmmodulebase.h:22
std::shared_ptr< flint::RecordAccumulatorWithMutex2< PoolInfoRow, PoolInfoRecord > > _poolInfoDimension
Definition: cbmaggregatorlandunitdata.h:76
flint::IVariable * _landClass
Definition: cbmaggregatorlandunitdata.h:93
std::string _classifierSetVar
Definition: cbmaggregatorlandunitdata.h:99
std::shared_ptr< flint::RecordAccumulatorWithMutex2< ClassifierSetRow, ClassifierSetRecord > > _classifierSetDimension
Definition: cbmaggregatorlandunitdata.h:77
std::shared_ptr< flint::RecordAccumulatorWithMutex2< PoolRow, PoolRecord > > _poolDimension
Definition: cbmaggregatorlandunitdata.h:81
std::shared_ptr< flint::RecordAccumulatorWithMutex2< AgeAreaRow, AgeAreaRecord > > _ageAreaDimension
Definition: cbmaggregatorlandunitdata.h:84
std::shared_ptr< flint::RecordAccumulatorWithMutex2< LocationErrorRow, LocationErrorRecord > > _locationErrorDimension
Definition: cbmaggregatorlandunitdata.h:88
bool _isPrimaryAggregator
Definition: cbmaggregatorlandunitdata.h:98
std::shared_ptr< Poco::Mutex > _classifierNamesLock
Definition: cbmaggregatorlandunitdata.h:90
Definition: cbmaggregatorcsvwriter.h:19
std::shared_ptr< flint::RecordAccumulatorWithMutex2< DisturbanceTypeRow, DisturbanceTypeRecord > > _disturbanceTypeDimension
Definition: cbmaggregatorlandunitdata.h:85
Definition: cbmaggregatorlandunitdata.h:23
flint::IVariable * _classifierSet
Definition: cbmaggregatorlandunitdata.h:92
std::shared_ptr< flint::RecordAccumulatorWithMutex2< LandClassRow, LandClassRecord > > _landClassDimension
Definition: cbmaggregatorlandunitdata.h:78
CBMAggregatorLandUnitData(std::shared_ptr< flint::RecordAccumulatorWithMutex2< DateRow, DateRecord >> dateDimension, std::shared_ptr< flint::RecordAccumulatorWithMutex2< PoolInfoRow, PoolInfoRecord >> poolInfoDimension, std::shared_ptr< flint::RecordAccumulatorWithMutex2< ClassifierSetRow, ClassifierSetRecord >> classifierSetDimension, std::shared_ptr< flint::RecordAccumulatorWithMutex2< LandClassRow, LandClassRecord >> landClassDimension, std::shared_ptr< flint::RecordAccumulatorWithMutex2< TemporalLocationRow, TemporalLocationRecord >> locationDimension, std::shared_ptr< flint::RecordAccumulatorWithMutex2< ModuleInfoRow, ModuleInfoRecord >> moduleInfoDimension, std::shared_ptr< flint::RecordAccumulatorWithMutex2< DisturbanceTypeRow, DisturbanceTypeRecord >> disturbanceTypeDimension, std::shared_ptr< flint::RecordAccumulatorWithMutex2< DisturbanceRow, DisturbanceRecord >> disturbanceDimension, std::shared_ptr< std::vector< std::string >> classifierNames, std::shared_ptr< Poco::Mutex > classifierNamesLock, std::shared_ptr< flint::RecordAccumulatorWithMutex2< PoolRow, PoolRecord >> poolDimension, std::shared_ptr< flint::RecordAccumulatorWithMutex2< FluxRow, FluxRecord >> fluxDimension, std::shared_ptr< flint::RecordAccumulatorWithMutex2< AgeClassRow, AgeClassRecord >> AgeClassDimension, std::shared_ptr< flint::RecordAccumulatorWithMutex2< AgeAreaRow, AgeAreaRecord >> AgeAreaDimension, std::shared_ptr< flint::RecordAccumulatorWithMutex2< ErrorRow, ErrorRecord >> errorDimension, std::shared_ptr< flint::RecordAccumulatorWithMutex2< LocationErrorRow, LocationErrorRecord >> locationErrorDimension)
Definition: cbmaggregatorlandunitdata.h:25
Int64 _previousLocationId
Definition: cbmaggregatorlandunitdata.h:97
Definition: ageclasshelper.h:11
Definition: ageclasshelper.cpp:10
std::shared_ptr< flint::RecordAccumulatorWithMutex2< DateRow, DateRecord > > _dateDimension
Definition: cbmaggregatorlandunitdata.h:75
std::shared_ptr< flint::RecordAccumulatorWithMutex2< ModuleInfoRow, ModuleInfoRecord > > _moduleInfoDimension
Definition: cbmaggregatorlandunitdata.h:80
std::shared_ptr< flint::RecordAccumulatorWithMutex2< FluxRow, FluxRecord > > _fluxDimension
Definition: cbmaggregatorlandunitdata.h:82
std::shared_ptr< std::vector< std::string > > _classifierNames
Definition: cbmaggregatorlandunitdata.h:89
double _landUnitArea
Definition: cbmaggregatorlandunitdata.h:96