BPMN-OS
BPMN for optimization and simulation
Loading...
Searching...
No Matches
BPMNOS::Execution::GreedyDispatcher< WeakPtrs > Class Template Reference

Class for dispatching the event with the best evaluation. More...

Detailed Description

template<typename... WeakPtrs>
class BPMNOS::Execution::GreedyDispatcher< WeakPtrs >

Definition at line 18 of file GreedyDispatcher.h.

#include <GreedyDispatcher.h>

Inheritance diagram for BPMNOS::Execution::GreedyDispatcher< WeakPtrs >:

Public Member Functions

 GreedyDispatcher (Evaluator *evaluator)
 
virtual ~GreedyDispatcher ()=default
 
std::shared_ptr< EventdispatchEvent (const SystemState *systemState) override
 
void connect (Mediator *mediator) override
 
void notice (const Observable *observable) override
 
- Public Member Functions inherited from BPMNOS::Execution::EventDispatcher
virtual ~EventDispatcher ()=default
 
virtual void notice (Event *event)
 
- Public Member Functions inherited from BPMNOS::Execution::Observer

Public Attributes

BPMNOS::number timestamp
 

Protected Member Functions

void addEvaluation (WeakPtrs..., std::shared_ptr< Decision > decision, std::optional< double > reward)
 
virtual void dataUpdate (const DataUpdate *update)
 
bool intersect (const std::vector< const BPMNOS::Model::Attribute * > &first, const std::set< const BPMNOS::Model::Attribute * > &second) const
 
void removeObsolete (const DataUpdate *update, auto_list< WeakPtrs..., std::shared_ptr< Decision > > &evaluation, auto_list< WeakPtrs..., std::shared_ptr< Decision > > &unevaluatedDecisions)
 
void removeDependentEvaluations (const DataUpdate *update, std::unordered_map< long unsigned int, auto_list< WeakPtrs..., std::shared_ptr< Decision > > > &evaluatedDecisions, auto_list< WeakPtrs..., std::shared_ptr< Decision > > &unevaluatedDecisions)
 
void clockTick ()
 

Protected Attributes

Evaluatorevaluator
 
auto_list< WeakPtrs..., std::shared_ptr< Decision > > decisionsWithoutEvaluation
 
auto_set< double, WeakPtrs..., std::weak_ptr< Event > > evaluatedDecisions
 
auto_list< WeakPtrs..., std::shared_ptr< Decision > > invariantEvaluations
 
auto_list< WeakPtrs..., std::shared_ptr< Decision > > timeDependentEvaluations
 
std::unordered_map< long unsigned int, auto_list< WeakPtrs..., std::shared_ptr< Decision > > > dataDependentEvaluations
 
std::unordered_map< long unsigned int, auto_list< WeakPtrs..., std::shared_ptr< Decision > > > timeAndDataDependentEvaluations
 

Constructor & Destructor Documentation

◆ GreedyDispatcher()

template<typename... WeakPtrs>
GreedyDispatcher::GreedyDispatcher ( Evaluator * evaluator)

Definition at line 10 of file GreedyDispatcher.cpp.

◆ ~GreedyDispatcher()

template<typename... WeakPtrs>
virtual BPMNOS::Execution::GreedyDispatcher< WeakPtrs >::~GreedyDispatcher ( )
virtualdefault

Member Function Documentation

◆ addEvaluation()

template<typename... WeakPtrs>
void GreedyDispatcher::addEvaluation ( WeakPtrs... weak_ptrs,
std::shared_ptr< Decision > decision,
std::optional< double > reward )
protected

Definition at line 28 of file GreedyDispatcher.cpp.

◆ clockTick()

template<typename... WeakPtrs>
void GreedyDispatcher::clockTick ( )
protected

Definition at line 151 of file GreedyDispatcher.cpp.

◆ connect()

template<typename... WeakPtrs>
void GreedyDispatcher::connect ( Mediator * mediator)
overridevirtual

Reimplemented from BPMNOS::Execution::EventDispatcher.

Definition at line 20 of file GreedyDispatcher.cpp.

◆ dataUpdate()

template<typename... WeakPtrs>
void GreedyDispatcher::dataUpdate ( const DataUpdate * update)
protectedvirtual

Definition at line 145 of file GreedyDispatcher.cpp.

◆ dispatchEvent()

template<typename... WeakPtrs>
std::shared_ptr< Event > GreedyDispatcher::dispatchEvent ( const SystemState * systemState)
overridevirtual

Implements BPMNOS::Execution::EventDispatcher.

Definition at line 60 of file GreedyDispatcher.cpp.

◆ intersect()

template<typename... WeakPtrs>
bool GreedyDispatcher::intersect ( const std::vector< const BPMNOS::Model::Attribute * > & first,
const std::set< const BPMNOS::Model::Attribute * > & second ) const
protected

Definition at line 97 of file GreedyDispatcher.cpp.

◆ notice()

template<typename... WeakPtrs>
void GreedyDispatcher::notice ( const Observable * observable)
overridevirtual

Implements BPMNOS::Execution::Observer.

Definition at line 89 of file GreedyDispatcher.cpp.

◆ removeDependentEvaluations()

template<typename... WeakPtrs>
void GreedyDispatcher::removeDependentEvaluations ( const DataUpdate * update,
std::unordered_map< long unsigned int, auto_list< WeakPtrs..., std::shared_ptr< Decision > > > & evaluatedDecisions,
auto_list< WeakPtrs..., std::shared_ptr< Decision > > & unevaluatedDecisions )
protected

Definition at line 126 of file GreedyDispatcher.cpp.

◆ removeObsolete()

template<typename... WeakPtrs>
void GreedyDispatcher::removeObsolete ( const DataUpdate * update,
auto_list< WeakPtrs..., std::shared_ptr< Decision > > & evaluation,
auto_list< WeakPtrs..., std::shared_ptr< Decision > > & unevaluatedDecisions )
protected

Definition at line 107 of file GreedyDispatcher.cpp.

Member Data Documentation

◆ dataDependentEvaluations

template<typename... WeakPtrs>
std::unordered_map< long unsigned int, auto_list< WeakPtrs..., std::shared_ptr<Decision> > > BPMNOS::Execution::GreedyDispatcher< WeakPtrs >::dataDependentEvaluations
protected

Definition at line 40 of file GreedyDispatcher.h.

◆ decisionsWithoutEvaluation

template<typename... WeakPtrs>
auto_list< WeakPtrs..., std::shared_ptr<Decision> > BPMNOS::Execution::GreedyDispatcher< WeakPtrs >::decisionsWithoutEvaluation
protected

Definition at line 28 of file GreedyDispatcher.h.

◆ evaluatedDecisions

template<typename... WeakPtrs>
auto_set< double, WeakPtrs..., std::weak_ptr<Event> > BPMNOS::Execution::GreedyDispatcher< WeakPtrs >::evaluatedDecisions
protected

Definition at line 32 of file GreedyDispatcher.h.

◆ evaluator

template<typename... WeakPtrs>
Evaluator* BPMNOS::Execution::GreedyDispatcher< WeakPtrs >::evaluator
protected

Definition at line 27 of file GreedyDispatcher.h.

◆ invariantEvaluations

template<typename... WeakPtrs>
auto_list< WeakPtrs..., std::shared_ptr<Decision> > BPMNOS::Execution::GreedyDispatcher< WeakPtrs >::invariantEvaluations
protected

Definition at line 38 of file GreedyDispatcher.h.

◆ timeAndDataDependentEvaluations

template<typename... WeakPtrs>
std::unordered_map< long unsigned int, auto_list< WeakPtrs..., std::shared_ptr<Decision> > > BPMNOS::Execution::GreedyDispatcher< WeakPtrs >::timeAndDataDependentEvaluations
protected

Definition at line 41 of file GreedyDispatcher.h.

◆ timeDependentEvaluations

template<typename... WeakPtrs>
auto_list< WeakPtrs..., std::shared_ptr<Decision> > BPMNOS::Execution::GreedyDispatcher< WeakPtrs >::timeDependentEvaluations
protected

Definition at line 39 of file GreedyDispatcher.h.

◆ timestamp

template<typename... WeakPtrs>
BPMNOS::number BPMNOS::Execution::GreedyDispatcher< WeakPtrs >::timestamp

Definition at line 25 of file GreedyDispatcher.h.


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