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

#include <peatlanddisturbance.h>

Inherits ModuleBase.

Collaboration diagram for PeatlandDisturbance:
Collaboration graph

Public Member Functions

 PeatlandDisturbance ()
 
virtual ~PeatlandDisturbance ()
 
void configure (const DynamicObject &config) override
 
void subscribe (NotificationCenter &notificationCenter) override
 
void onDisturbanceEvent (const flint::DisturbanceEventNotification::Ptr) override
 
void onLocalDomainInit () override
 
void onTimingInit () override
 

Private Member Functions

void fetchDMAssociations ()
 

Private Attributes

flint::IVariable * _spu
 
int _spuId
 
std::unordered_map< std::pair< std::string, int >, int > _dmAssociations
 

Constructor & Destructor Documentation

◆ PeatlandDisturbance()

◆ ~PeatlandDisturbance()

virtual ~PeatlandDisturbance ( )
virtual

Member Function Documentation

◆ configure()

void configure ( const DynamicObject &  config)
override

Configuration function

Parameters
configDynamicObject&
Returns
void

◆ fetchDMAssociations()

void fetchDMAssociations ( )
private

Insert DMAssociations.

Clear contents of PeatlandDisturbance._dmAssociations
For each disturbance matrix association contained in variable "disturbance_matrix_associations" of _landUnitData,
insert into PeatlandDisturbance._dmAssociations the values of variables "disturbance_type", "spatial_unit_id",
and "disturbance_matrix_id" as a triplet using make_pair

◆ onDisturbanceEvent()

void onDisturbanceEvent ( const flint::DisturbanceEventNotification::Ptr  n)
override

Get the disturbance type for either historical or last disturbance event

Get the value of the pair disturbance type, value of "disturbance" in parameter n, and PeatlandDisturbance._spuId and set it to dmId
Create a shared pointer of type CBMDistEventTransfer with parameters *_landUnitData, "CO2", "CH4", dmId, 0.102, add this to PeatlandDisturbance.transfer

Parameters
nflint::DisturbanceEventNotification::Ptr
Returns
void

◆ onLocalDomainInit()

void onLocalDomainInit ( )
override

Assign PeatlandDisturbance._spu value of variable "spatial_unit_id" in _landUnitData

Returns
void

◆ onTimingInit()

void onTimingInit ( )
override

◆ 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::pair<std::string, int>, int> _dmAssociations
private

◆ _spu

flint::IVariable* _spu
private

◆ _spuId

int _spuId
private

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