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

#include <mossdisturbancemodule.h>

Inheritance diagram for MossDisturbanceModule:
Inheritance graph
Collaboration diagram for MossDisturbanceModule:
Collaboration graph

Public Member Functions

 MossDisturbanceModule ()
 
virtual ~MossDisturbanceModule ()
 
void configure (const DynamicObject &config) override
 
void subscribe (NotificationCenter &notificationCenter) override
 
void doDisturbanceEvent (DynamicVar) override
 
void doLocalDomainInit () override
 
void doTimingInit () 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 doOutputStep ()
 
virtual void doError (std::string msg)
 
virtual void doPrePostDisturbanceEvent ()
 
virtual void doPostDisturbanceEvent ()
 
virtual void doPostDisturbanceEvent2 ()
 
virtual void doPostNotification (short preMessageSignal)
 

Public Attributes

const std::string fireEvent = "fire"
 

Private Types

typedef std::vector< CBMDistEventTransferEventVector
 
typedef std::unordered_map< int, EventVectorEventMap
 

Private Member Functions

void fetchMossDistMatrices ()
 
void fetchMossDMAssociations ()
 

Private Attributes

bool _runMoss
 
EventMap _matrices
 
std::unordered_map< std::string, int > _dmAssociations
 

Member Typedef Documentation

◆ EventMap

typedef std::unordered_map<int, EventVector> EventMap
private

◆ EventVector

typedef std::vector<CBMDistEventTransfer> EventVector
private

Constructor & Destructor Documentation

◆ MossDisturbanceModule()

◆ ~MossDisturbanceModule()

virtual ~MossDisturbanceModule ( )
virtual

Member Function Documentation

◆ configure()

void configure ( const DynamicObject &  config)
override

Configuration function

Parameters
configconst DynamicObject&
Returns
void

◆ doDisturbanceEvent()

void doDisturbanceEvent ( DynamicVar  n)
overridevirtual

If MossDisturbanceModule.runMoss is false, return.
Else, get the disturbance type for either historical or last disturbance event from "disturbance" in parameter n, and check if it is fire disturbance, MossDisturbanceModule::fireEvent
If it is a fire disturbance and runMoss is true, for every source and sink pool pairs, in _sourcePools and _destPools, obtain th transfer rates from _transferRates.
Instantiate an object of CBMDistEventTransfer with *_landUnitData, sourcePoolName, sinkPoolName, transferRate and append it to "transfers" in parameter n

Parameters
nDynamicVar
Returns
void

Reimplemented from CBMModuleBase.

◆ doLocalDomainInit()

void doLocalDomainInit ( )
overridevirtual

Invoke MossDisturbanceModule.recordMossTransfers() on the value of variable "moss_fire_parameters" in _landUnitData

Returns
void

Reimplemented from CBMModuleBase.

◆ doTimingInit()

void doTimingInit ( )
overridevirtual

If variable "enable_moss" exists in _landUnitData and it has a value, invoke Helper.runMoss() with arguments as value of variables "growth_curve_id", "moss_leading_species" and "leading_species" in _landUnitData
Assign MossDisturbanceModule.runMoss to true if variable "peatland_class" in _landUnitData is empty, variable "growth_curve_id" in _landUnitData is not empty, and Helper.runMoss() returns true

Returns
void

Reimplemented from CBMModuleBase.

◆ fetchMossDistMatrices()

void fetchMossDistMatrices ( )
private

◆ fetchMossDMAssociations()

void fetchMossDMAssociations ( )
private

◆ subscribe()

void subscribe ( NotificationCenter &  notificationCenter)
override

Subscribe to the signals LocalDomainInit, DisturbanceEvent and TimingInit

Parameters
notificationCenterNotificationCenter&
Returns
void

Member Data Documentation

◆ _dmAssociations

std::unordered_map<std::string, int> _dmAssociations
private

◆ _matrices

EventMap _matrices
private

◆ _runMoss

bool _runMoss
private

◆ fireEvent

const std::string fireEvent = "fire"

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