BPMN-OS
BPMN for optimization and simulation
Loading...
Searching...
No Matches
BPMNOS::Execution::Engine Class Reference

Detailed Description

Definition at line 30 of file Engine.h.

#include <Engine.h>

Inheritance diagram for BPMNOS::Execution::Engine:

Classes

class  Command
 Class storing a command to be executed by the engine. More...
 

Public Member Functions

 Engine ()
 
 ~Engine ()
 
BPMNOS::number run (const BPMNOS::Model::Scenario *scenario, BPMNOS::number timeout=std::numeric_limits< BPMNOS::number >::max())
 Runs a scenario as long as there is a token or new instantiations. Terminates when the time if the system exceeds the timeout.
 
void process (const ReadyEvent *event)
 
void process (const EntryEvent *event)
 
void process (const ChoiceEvent *event)
 
void process (const CompletionEvent *event)
 
void process (const MessageDeliveryEvent *event)
 
void process (const ExitEvent *event)
 
void process (const ErrorEvent *event)
 
void process (const ClockTickEvent *event)
 
void process (const TerminationEvent *event)
 
BPMNOS::number getCurrentTime ()
 Returns the timestamp the engine is in.
 
const SystemStategetSystemState ()
 Returns a pointer to the system state.
 
- Public Member Functions inherited from BPMNOS::Execution::EventListener
void subscribe (EventDispatcher *eventDispatcher)
 
- Public Member Functions inherited from BPMNOS::Execution::Notifier
 Notifier ()
 
virtual ~Notifier ()=default
 
template<typename... ObservableTypes>
void addSubscriber (Observer *subscriber, ObservableTypes... observableTypes)
 
void notify (const Observable *observable) const
 
void notify (const Observable &observable) const
 

Protected Member Functions

void addInstances ()
 Method adding all new instances and advancing tokens as much as possible.
 
void deleteInstance (StateMachine *instance)
 Method removing completed instance.
 
bool advance ()
 
- Protected Member Functions inherited from BPMNOS::Execution::EventListener
std::shared_ptr< EventfetchEvent (SystemState *systemState)
 

Protected Attributes

std::list< Commandcommands
 List of commands to be executed.
 
BPMNOS::number clockTick
 Timestep used to advance the current time by systemState.time += clockTick.
 
std::unique_ptr< SystemStatesystemState
 
std::unique_ptr< ConditionalEventObserverconditionalEventObserver
 
- Protected Attributes inherited from BPMNOS::Execution::EventListener
std::vector< EventDispatcher * > eventDispatchers
 

Friends

class Token
 
class StateMachine
 
class ConditionalEventObserver
 

Constructor & Destructor Documentation

◆ Engine()

Engine::Engine ( )

Definition at line 15 of file Engine.cpp.

◆ ~Engine()

Engine::~Engine ( )

Definition at line 20 of file Engine.cpp.

Member Function Documentation

◆ addInstances()

void Engine::addInstances ( )
protected

Definition at line 106 of file Engine.cpp.

◆ advance()

bool Engine::advance ( )
protected

Definition at line 64 of file Engine.cpp.

◆ deleteInstance()

void Engine::deleteInstance ( StateMachine * instance)
protected

Definition at line 124 of file Engine.cpp.

◆ getCurrentTime()

BPMNOS::number Engine::getCurrentTime ( )

Definition at line 264 of file Engine.cpp.

◆ getSystemState()

const SystemState * Engine::getSystemState ( )

Definition at line 268 of file Engine.cpp.

◆ process() [1/9]

void Engine::process ( const ChoiceEvent * event)

Definition at line 161 of file Engine.cpp.

◆ process() [2/9]

void Engine::process ( const ClockTickEvent * event)

Definition at line 241 of file Engine.cpp.

◆ process() [3/9]

void Engine::process ( const CompletionEvent * event)

Definition at line 180 of file Engine.cpp.

◆ process() [4/9]

void Engine::process ( const EntryEvent * event)

Definition at line 144 of file Engine.cpp.

◆ process() [5/9]

void Engine::process ( const ErrorEvent * event)

Definition at line 236 of file Engine.cpp.

◆ process() [6/9]

void Engine::process ( const ExitEvent * event)

Definition at line 219 of file Engine.cpp.

◆ process() [7/9]

void Engine::process ( const MessageDeliveryEvent * event)

Definition at line 193 of file Engine.cpp.

◆ process() [8/9]

void Engine::process ( const ReadyEvent * event)

Definition at line 129 of file Engine.cpp.

◆ process() [9/9]

void Engine::process ( const TerminationEvent * event)

Definition at line 259 of file Engine.cpp.

◆ run()

BPMNOS::number Engine::run ( const BPMNOS::Model::Scenario * scenario,
BPMNOS::number timeout = std::numeric_limits<BPMNOS::number>::max() )

Definition at line 39 of file Engine.cpp.

Friends And Related Symbol Documentation

◆ ConditionalEventObserver

friend class ConditionalEventObserver
friend

Definition at line 33 of file Engine.h.

◆ StateMachine

friend class StateMachine
friend

Definition at line 32 of file Engine.h.

◆ Token

friend class Token
friend

Definition at line 31 of file Engine.h.

Member Data Documentation

◆ clockTick

BPMNOS::number BPMNOS::Execution::Engine::clockTick
protected

Definition at line 97 of file Engine.h.

◆ commands

std::list<Command> BPMNOS::Execution::Engine::commands
protected

Definition at line 91 of file Engine.h.

◆ conditionalEventObserver

std::unique_ptr<ConditionalEventObserver> BPMNOS::Execution::Engine::conditionalEventObserver
protected

Definition at line 99 of file Engine.h.

◆ systemState

std::unique_ptr<SystemState> BPMNOS::Execution::Engine::systemState
protected

Definition at line 98 of file Engine.h.


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