|
GCBM
|
#include <cbmaggregatorlandunitdata.h>


Public Member Functions | |
| 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) | |
| virtual | ~CBMAggregatorLandUnitData ()=default |
| void | configure (const DynamicObject &config) override |
| void | subscribe (NotificationCenter ¬ificationCenter) override |
| flint::ModuleTypes | moduleType () override |
| void | doLocalDomainInit () override |
| void | doTimingInit () override |
| void | doOutputStep () override |
| void | doError (std::string msg) override |
Public Member Functions inherited from CBMModuleBase | |
| virtual | ~CBMModuleBase ()=default |
| void | onSystemInit () override |
| void | onSystemShutdown () override |
| void | onLocalDomainInit () override |
| void | onLocalDomainShutdown () override |
| void | onLocalDomainProcessingUnitInit () override |
| void | onLocalDomainProcessingUnitShutdown () override |
| void | onPreTimingSequence () override |
| void | onTimingInit () override |
| void | onTimingPrePostInit () override |
| void | onTimingPostInit () override |
| void | onTimingPostInit2 () override |
| void | onTimingShutdown () override |
| void | onTimingStep () override |
| void | onTimingPreEndStep () override |
| void | onTimingEndStep () override |
| void | onTimingPostStep () override |
| void | onOutputStep () override |
| void | onPrePostDisturbanceEvent () override |
| void | onPostDisturbanceEvent () override |
| void | onPostDisturbanceEvent2 () override |
| void | onError (std::string msg) override |
| void | onDisturbanceEvent (DynamicVar e) override |
| void | onPostNotification (short preMessageSignal) override |
| virtual void | doSystemInit () |
| virtual void | doSystemShutdown () |
| virtual void | doLocalDomainShutdown () |
| virtual void | doLocalDomainProcessingUnitInit () |
| virtual void | doLocalDomainProcessingUnitShutdown () |
| virtual void | doPreTimingSequence () |
| virtual void | doTimingPrePostInit () |
| virtual void | doTimingPostInit () |
| virtual void | doTimingPostInit2 () |
| virtual void | doTimingShutdown () |
| virtual void | doTimingStep () |
| virtual void | doTimingPreEndStep () |
| virtual void | doTimingEndStep () |
| virtual void | doTimingPostStep () |
| virtual void | doDisturbanceEvent (DynamicVar) |
| virtual void | doPrePostDisturbanceEvent () |
| virtual void | doPostDisturbanceEvent () |
| virtual void | doPostDisturbanceEvent2 () |
| virtual void | doPostNotification (short preMessageSignal) |
Private Member Functions | |
| Int64 | getPoolId (const flint::IPool *pool) |
| Int64 | recordLocation (bool isSpinup) |
| void | recordLandUnitData (bool isSpinup) |
| void | recordPoolsSet (Int64 locationId) |
| void | recordFluxSet (Int64 locationId) |
| void | recordClassifierNames (const DynamicObject &classifierSet) |
| void | recordAgeArea (Int64 locationId) |
| void | recordAgeClass () |
| bool | hasDisturbanceInfo (std::shared_ptr< flint::IOperationResult > flux) |
|
virtualdefault |
|
override |
Configuration function
Initialise CBMAggregatorLandUnitData._classifierSetVar as variable "reporting_classifier_set" in paramter config if it exists,
else to "classifier_set"
| config | DynamicObject& |
|
overridevirtual |
doError
Detailed description here
| msg | string |
Reimplemented from CBMModuleBase.
|
overridevirtual |
Initiate Local Domain
Initialize spatial location info, classifier set and land class.
Reimplemented from CBMModuleBase.
|
overridevirtual |
Invoke CBMAggregatorLandUnitData.recordLandUnitData() with argument false
Reimplemented from CBMModuleBase.
|
overridevirtual |
|
private |
Return the Pool Id.
Create an object poolInfo of class PoolInfoRecord,
Search poolInfo in CBMAggregatorLandUnitData._poolInfoDimension and return the Id
| pool | IPool* |
|
private |
Check for existence of disturbances
If method hasDataPackage() of parameter flux is false return false,
If paramter flux contains all the disturbance data return true, else return false
| flux | shared_ptr<IOperationResult> |
|
override |
|
private |
Record Age Area
Assign variable standAge the value of variable "age" in _landUnitArea,
ageClass as AgeClassHelper.toAgeClass() with argument standAge
, ageClassRange as AgeClassHelper.getAgeClass() with argument ageClass.
Instantiate object ageClassRecord of class AgeClassRecord with argument ageClassRange,
invoke the accumulate method on CBMAggregatorLandUnitData._ageClassDimension with argument ageClassRecord, assign it to ageClassId.
Instantiate object ageAreaRecord of class AgeAreaRecord with locationId, ageClassId, _landUnitArea.
Invoke accumulate method of CBMAggregatorLandUnitData._ageAreaDimension on ageAreaRecord
| locationId | Int64 |
|
private |
Record Age Class
Instantiate object CBMAggregatorLandUnitData._ageClassHelper of class AgeClassHelper if _landUnitData has the variables "age_class_range" and "age_maximum",
For each ageClass in AgeClassHelper.getAgeClasses()
|
private |
Record Classifier Names
Acquire Poco::Mutex::Scoped lock on *_classifierNamesLock
If CBMAggregatorLandUnitData._classifierNames is not empty,
for each classifier in paramter classifierSet, in the string classifier.first, replace '.' and ' '
by '_' and append it to CBMAggregatorLandUnitData._classifierNames
| classifierSet | DynamicObject& |
|
private |
Record the Flux Set
If Flux set, i.e if _landUnitData->getOperationLastAppliedIterator() is empty, return immediately.
| locationId | Int64 |
|
private |
Record Land Unit Data
Assign the result of CBMAggregatorLandUnitData.recordLocation() to a variable locationId If the value of isSpinup is True, set CBMAggregatorLandUnitData._previousLocationId as locationId
invoke CBMAggregatorLandUnitData.recordPoolsSet(), CBMAggregatorLandUnitData.recordFluxSet(), CBMAggregatorLandUnitData.recordAgeArea() with parameter locationId
and set CBMAggregatorLandUnitData._previousLocationId as locationId
| isSpinup | bool |
|
private |
Record Location
If parameter isSpinup is true, instantiate an object of class DateRecord with default values, else assign it with the current time of the simulation from _landUnitData
If CBMAggregatorLandUnitData._classifierNames is empty, invoke CBMAggregatorLandUnitData.recordClassifierNames()
For each classifier in CBMAggregatorLandUnitData._classifierSet, append classifier.second to a variable classifierSet
Instantiate an object of class TemporalLocationRecord with parameters classifierSetRecordId, dateRecordId, landClassRecordId, ageClassId, _landUnitArea
Return the Id of accumulated value of locationRecord in CBMAggregatorLandUnitData._locationDimension
| isSpinup | bool |
|
private |
Record Pools Set
For each pool in _landUnitData->poolCollection(), create an object poolInfo of PoolInfoRecord with the pool name
Assign poolId the Id of poolInfo in CBMAggregatorLandUnitData._poolInfoDimension , poolValue pool->value() * CBMAggregatorLandUnitData._landUnitArea
Instantiate an object poolRecord of PoolRecord with locationId, poolId, poolValue
Invoke accumulate method of CBMAggregatorLandUnitData._poolDimension on poolRecord
| locationId | Int64 |
|
override |
Subcribe to the signals LocalDomainInit, TimingInit, OutputStep, Error
| notificationCenter | NotificationCenter& |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
1.8.17