BPMN-OS
BPMN for optimization and simulation
Loading...
Searching...
No Matches
GreedyController.h
Go to the documentation of this file.
1#ifndef BPMNOS_Execution_GreedyController_H
2#define BPMNOS_Execution_GreedyController_H
3
4#include <bpmn++.h>
5#include "Controller.h"
6#include "Evaluator.h"
8
9namespace BPMNOS::Execution {
10
11/**
12 * @brief A controller dispatching the best evaluated decisions
13 */
15public:
16 struct Config {
17 bool bestFirstEntry = true;
18 bool bestFirstExit = true;
19 };
20 static Config default_config() { return {}; } // Work around for compiler bug see: https://stackoverflow.com/questions/53408962/try-to-understand-compiler-error-message-default-member-initializer-required-be/75691051#75691051
22 void connect(Mediator* mediator);
23 std::vector< std::unique_ptr<EventDispatcher> > eventDispatchers;
24protected:
27 std::shared_ptr<Event> dispatchEvent(const SystemState* systemState);
28};
29
30} // namespace BPMNOS::Execution
31
32#endif // BPMNOS_Execution_GreedyController_H
33
Base class for an execution controller which dispatches events to the engine and listens to notificat...
Definition Controller.h:15
Represents an abstract base class for an evaluator determining feasibility and reward of a decision.
Definition Evaluator.h:15
A controller dispatching the best evaluated decisions.
std::vector< std::unique_ptr< EventDispatcher > > eventDispatchers
GreedyController(Evaluator *evaluator, Config config=default_config())
std::shared_ptr< Event > dispatchEvent(const SystemState *systemState)
A class representing the state that the execution or simulation of a given scenario is in.
Definition SystemState.h:21
Represents an abstract base class for a class that is an event listener and notifier.
Definition Mediator.h:13