BPMN-OS
BPMN for optimization and simulation
Loading...
Searching...
No Matches
DeterministicTaskCompletion.cpp
Go to the documentation of this file.
3#include <cassert>
4
5using namespace BPMNOS::Execution;
6
10
11std::shared_ptr<Event> DeterministicTaskCompletion::dispatchEvent( const SystemState* systemState ) {
12 for ( auto [time,token_ptr] : systemState->tokensAwaitingCompletionEvent ) {
13 if ( time <= systemState->getTime() ) {
14 if ( auto token = token_ptr.lock() ) {
15 assert( token );
16 return std::make_shared<CompletionEvent>(token.get());
17 }
18 }
19 }
20 return nullptr;
21}
std::shared_ptr< Event > dispatchEvent(const SystemState *systemState) override
A class representing the state that the execution or simulation of a given scenario is in.
Definition SystemState.h:21
auto_set< BPMNOS::number, std::weak_ptr< Token > > tokensAwaitingCompletionEvent
Sorted container holding all tokens awaiting a task completion event.
Definition SystemState.h:77