GCBM
Public Member Functions | Private Member Functions | Private Attributes | List of all members
StandMaturityModule Class Reference

#include <standmaturitymodule.h>

Inheritance diagram for StandMaturityModule:
Inheritance graph
Collaboration diagram for StandMaturityModule:
Collaboration graph

Public Member Functions

 StandMaturityModule (std::shared_ptr< StandGrowthCurveFactory > gcFactory, std::shared_ptr< VolumeToBiomassCarbonGrowth > volumeToBioGrowth)
 
void subscribe (NotificationCenter &notificationCenter) override
 
flint::ModuleTypes moduleType () override
 
void doLocalDomainInit () override
 
void doTimingInit () override
 
void doTimingEndStep () 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 doTimingPostStep ()
 
virtual void doOutputStep ()
 
virtual void doError (std::string msg)
 
virtual void doDisturbanceEvent (DynamicVar)
 
virtual void doPrePostDisturbanceEvent ()
 
virtual void doPostDisturbanceEvent ()
 
virtual void doPostDisturbanceEvent2 ()
 
virtual void doPostNotification (short preMessageSignal)
 

Private Member Functions

double getCurrentFoliageValue ()
 

Private Attributes

const flint::ILandUnitController * _landUnitController
 
const flint::IVariable * _age
 
const flint::IVariable * _gcId
 
const flint::IVariable * _spuId
 
flint::IVariable * _standMaturity
 
const flint::IPool * _swFoliage
 
const flint::IPool * _hwFoliage
 
DynamicVar _value
 
std::unordered_map< std::tuple< int, int >, double > _maxFoliageValues
 
std::shared_ptr< StandGrowthCurveFactory_gcFactory
 
std::shared_ptr< VolumeToBiomassCarbonGrowth_volumeToBioGrowth
 

Constructor & Destructor Documentation

◆ StandMaturityModule()

StandMaturityModule ( std::shared_ptr< StandGrowthCurveFactory gcFactory,
std::shared_ptr< VolumeToBiomassCarbonGrowth volumeToBioGrowth 
)

Member Function Documentation

◆ doLocalDomainInit()

void doLocalDomainInit ( )
overridevirtual

Assign StandMaturityModule._standMaturity, StandMaturityModule._age, StandMaturityModule._gcId, StandMaturityModule._spuId, StandMaturityModule._swFoilage, StandMaturityModule._hwFoilage values of variables "stand_maturity", "age", "growth_curve_id", "spatial_unit_id", "SoftwoodFoliage", "HardwoodFoliage" in _landUnitData

Returns
void

Reimplemented from CBMModuleBase.

◆ doTimingEndStep()

void doTimingEndStep ( )
overridevirtual

If the value of StandMaturityModule._gcId or StandMaturityModule._spuId or StandMaturityModule._age is empty, set the value of StandMaturityModule._standMaturity to 0.0 and return, else assign the values to variables standGrowthCurveId, spuId, ageVar
If isBiomassCarbonCurveAvailable() with arguments standGrowthCurveId, spuId on StandMaturityModule._volumeToBioGrowth is false, call createStandGrowthCurve() with arguments standGrowthCurveId, spuId, *_landUnitData on StandMaturityModule._gcFactory to create the stand growth curve, invoke generateBiomassCarbonCurve() on StandMaturityModule._volumeToBioGrowth to process and convert yield volume to carbon curves
Assign variable maxFoilage, the value corresponding to the tuple key (standGrowthCurveId, spuId) in StandMaturityModule._maxFoliageValues, if found.
Else, get the foilageCurve from getFoliageCarbonCurve() on StandMaturityModule._volumeToBioGrowth with arguments standGrowthCurveId, spuId. Assign maxFoilage the maximum of the iterator maxFoilage, if not empty, else 0 Set the value of the key (standGrowthCurveId, spuId) in StandMaturityModule._maxFoliageValues to maxFoilage
Set the value of StandMaturityModule._standMaturity to 0 if maxFoilage is 0, else to StandMaturityModule.getCurrentFoliageValue() / maxFoilage

Returns
void

Reimplemented from CBMModuleBase.

◆ doTimingInit()

void doTimingInit ( )
overridevirtual

Set the value of StandMaturityModule._standMaturity to 0.0

Returns
void

Reimplemented from CBMModuleBase.

◆ getCurrentFoliageValue()

double getCurrentFoliageValue ( )
private

Return the sum of the values of StandMaturityModule._swFoliage and StandMaturityModule._hwFoliage

Returns
double

◆ moduleType()

flint::ModuleTypes moduleType ( )
override

◆ subscribe()

void subscribe ( NotificationCenter &  notificationCenter)
override

Subscribe to the signals LocalDomainInit, TimingInit and TimingEndStep

Parameters
notificationCenterNotificationCenter&
Returns
void

Member Data Documentation

◆ _age

const flint::IVariable* _age
private

◆ _gcFactory

std::shared_ptr<StandGrowthCurveFactory> _gcFactory
private

◆ _gcId

const flint::IVariable* _gcId
private

◆ _hwFoliage

const flint::IPool* _hwFoliage
private

◆ _landUnitController

const flint::ILandUnitController* _landUnitController
private

◆ _maxFoliageValues

std::unordered_map<std::tuple<int, int>, double> _maxFoliageValues
mutableprivate

◆ _spuId

const flint::IVariable* _spuId
private

◆ _standMaturity

flint::IVariable* _standMaturity
private

◆ _swFoliage

const flint::IPool* _swFoliage
private

◆ _value

DynamicVar _value
mutableprivate

◆ _volumeToBioGrowth

std::shared_ptr<VolumeToBiomassCarbonGrowth> _volumeToBioGrowth
private

The documentation for this class was generated from the following files: