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

#include <growthmultipliermodule.h>

Inheritance diagram for GrowthMultiplierModule:
Inheritance graph
Collaboration diagram for GrowthMultiplierModule:
Collaboration graph

Public Member Functions

 GrowthMultiplierModule ()
 
virtual ~GrowthMultiplierModule ()=default
 
void configure (const DynamicObject &config) override
 
void subscribe (NotificationCenter &notificationCenter) override
 
flint::ModuleTypes moduleType ()
 
virtual void doDisturbanceEvent (DynamicVar) override
 
virtual void doLocalDomainInit () override
 
virtual void doTimingInit () override
 
virtual void doTimingStep () override
 
virtual void doTimingShutdown () 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 doTimingPreEndStep ()
 
virtual void doTimingEndStep ()
 
virtual void doTimingPostStep ()
 
virtual void doOutputStep ()
 
virtual void doError (std::string msg)
 
virtual void doPrePostDisturbanceEvent ()
 
virtual void doPostDisturbanceEvent ()
 
virtual void doPostDisturbanceEvent2 ()
 
virtual void doPostNotification (short preMessageSignal)
 

Private Member Functions

void advanceMultipliers ()
 
void clearMultipliers ()
 

Private Attributes

bool _moduleEnabled
 
bool _debuggingEnabled = false
 
flint::IVariable * _currentGrowthMultipliers
 
std::unordered_map< std::string, GrowthMultiplierSet_growthMultiplierSets
 
GrowthMultiplierSet _activeMultiplierSet
 

Constructor & Destructor Documentation

◆ GrowthMultiplierModule()

◆ ~GrowthMultiplierModule()

virtual ~GrowthMultiplierModule ( )
virtualdefault

Member Function Documentation

◆ advanceMultipliers()

void advanceMultipliers ( )
private

◆ clearMultipliers()

void clearMultipliers ( )
private

If GrowthMultiplierModule._moduleEnabled is false, return
Set the value of GrowthMultiplierModule._currentGrowthMultipliers to DynamicVar(), instantiate GrowthMultiplierModule._activeMultiplierSet as an object of GrowthMultiplierSet

Returns
void

◆ configure()

void configure ( const DynamicObject &  config)
override

Configuration function

Assign value of "debugging_enabled" in parameter config to GrowthMultiplierModule._debuggingEnabled if it exists

Parameters
configconst DynamicObject&
Returns
void

◆ doDisturbanceEvent()

void doDisturbanceEvent ( DynamicVar  e)
overridevirtual

If GrowthMultiplierModule._moduleEnabled is false, return.
Else if the disturbanceType in parameter e, given by "disturbance" is not found in GrowthMultiplierModule._growthMultiplierSets, assign GrowthMultiplierModule._activeMultiplierSet an object of GrowthMultiplierSet, else the GrowthMultiplierSet object corresponding to the disturbanceType in GrowthMultiplierModule._growthMultiplierSets.
If GrowthMultiplierModule._debuggingEnabled is true and GrowthMultiplierSet.end() returns false on GrowthMultiplierModule._activeMultiplierSet, print all the growth multipliers for the current disturbanceType stored in GrowthMultiplierModule._activeMultiplierSet

Parameters
eDynamicVar
Returns
void

Reimplemented from CBMModuleBase.

◆ doLocalDomainInit()

void doLocalDomainInit ( )
overridevirtual

If _landUnitData does not have variable "current_growth_multipliers", set GrowthMultiplierModule._moduleEnabled to false and return
Else, set GrowthMultiplierModule._moduleEnabled to true.
Assign GrowthMultiplierModule._currentGrowthMultipliers value of variable "current_growth_multipliers" in _landUnitData
For each multiplier in variable "growth_multipliers" of _landUnitData, if the "disturbance_type" of the multiplier is not found in GrowthMultiplierModule._growthMultiplierSets, create an object of GrowthMultiplierSet, invoke GrowthMultiplierSet.add() on the object with "forest_type", "time_step" and "multiplier" of the multiplier.
Add to GrowthMultiplierModule._growthMultiplierSets, the "disturbance_type" as a key and set it to the GrowthMultiplierModule object created

Returns
void

Reimplemented from CBMModuleBase.

◆ doTimingInit()

void doTimingInit ( )
overridevirtual

Invoke GrowthMultiplierModule.clearMultipliers()

Returns
void

Reimplemented from CBMModuleBase.

◆ doTimingShutdown()

void doTimingShutdown ( )
overridevirtual

Invoke GrowthMultiplierModule.clearMultipliers()

Returns
void

Reimplemented from CBMModuleBase.

◆ doTimingStep()

void doTimingStep ( )
overridevirtual

If GrowthMultiplierModule._moduleEnabled is false, return
Invoke GrowthMultiplierModule.advanceMultipliers()

Returns
void

Reimplemented from CBMModuleBase.

◆ moduleType()

flint::ModuleTypes moduleType ( )

◆ subscribe()

void subscribe ( NotificationCenter &  notificationCenter)
override

Subscribe to the signals LocalDomainInit, TimingInit, TimingStep, DisturbanceEvent and TimingShutdown

Parameters
notificationCenterNotificationCenter&
Returns
void

Member Data Documentation

◆ _activeMultiplierSet

GrowthMultiplierSet _activeMultiplierSet
private

◆ _currentGrowthMultipliers

flint::IVariable* _currentGrowthMultipliers
private

◆ _debuggingEnabled

bool _debuggingEnabled = false
private

◆ _growthMultiplierSets

std::unordered_map<std::string, GrowthMultiplierSet> _growthMultiplierSets
private

◆ _moduleEnabled

bool _moduleEnabled
private

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