BPMN-OS
BPMN for optimization and simulation
Loading...
Searching...
No Matches
MyopicDecisionTaskTerminator.cpp
Go to the documentation of this file.
3#include <cassert>
4
5using namespace BPMNOS::Execution;
6
10
11std::shared_ptr<Event> MyopicDecisionTaskTerminator::dispatchEvent( const SystemState* systemState ) {
12 // assume that feasible choices are already made by an appropriate handler
13 for ( auto& [token_ptr, request_ptr] : systemState->pendingChoiceDecisions ) {
14 if( auto request = request_ptr.lock() ) {
15 assert( request );
16 // raise error at decision task without prior decision
17 return std::make_shared<ErrorEvent>(request->token);
18 }
19 }
20 return nullptr;
21}
22
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_list< std::weak_ptr< Token >, std::weak_ptr< DecisionRequest > > pendingChoiceDecisions
Definition SystemState.h:72