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

A class representing the state that the execution or simulation of a given scenario is in. More...

Detailed Description

Definition at line 21 of file SystemState.h.

#include <SystemState.h>

Public Member Functions

 SystemState (const Engine *engine, const BPMNOS::Model::Scenario *scenario, BPMNOS::number currentTime=0)
 
 ~SystemState ()
 
BPMNOS::number getTime () const
 Function returning the assumed time time if available or the current time otherwise.
 
bool isAlive () const
 Function returning true if there are tokens in the system or if there may be new instantiations of tokens.
 
BPMNOS::number getObjective () const
 Returns the total objective value (assuming maximization) accumulated during execution.
 
std::optional< BPMNOS::ValuesgetStatusAttributes (const StateMachine *root, const BPMN::Node *node) const
 
std::optional< BPMNOS::ValuesgetDataAttributes (const StateMachine *root, const BPMN::Node *node) const
 
std::vector< std::tuple< const BPMN::Process *, BPMNOS::Values, BPMNOS::Values > > getInstantiations () const
 Method returning a vector of all instantiations at the given time.
 

Public Attributes

const BPMNOS::Model::Scenarioscenario
 Pointer to the corresponding scenario.
 
BPMNOS::number currentTime
 Timestamp holding the point in time that the engine is in (this is usually representing now).
 
std::optional< BPMNOS::numberassumedTime
 Timestamp holding the point in time that the simulation is in (this could be a future point in time).
 
BPMNOS::number contributionsToObjective
 All contributions that have already been added to the objective.
 
auto_list< std::weak_ptr< Token >, std::weak_ptr< DecisionRequest > > pendingEntryDecisions
 
auto_list< std::weak_ptr< Token >, std::weak_ptr< DecisionRequest > > pendingChoiceDecisions
 
auto_list< std::weak_ptr< Token >, std::weak_ptr< DecisionRequest > > pendingExitDecisions
 
auto_list< std::weak_ptr< Token >, std::weak_ptr< DecisionRequest > > pendingMessageDeliveryDecisions
 
auto_list< std::weak_ptr< Token > > tokensAwaitingReadyEvent
 Container holding all tokens awaiting a ready event.
 
auto_set< BPMNOS::number, std::weak_ptr< Token > > tokensAwaitingCompletionEvent
 Sorted container holding all tokens awaiting a task completion event.
 
std::unordered_map< long unsigned int, std::weak_ptr< StateMachine > > archive
 Container holding instance identifier and corresponding state machine pointer for each instantiation.
 
std::unordered_map< long unsigned int, auto_list< std::weak_ptr< Message > > > unsent
 Map holding unsent messages with recipient that isn't instantiated yet.
 
std::unordered_map< StateMachine *, auto_list< std::weak_ptr< Message > > > inbox
 Map holding the undelivered correspondence associated with a state machine which will be withdrawn when the state machine goes out of scope.
 
std::unordered_map< const BPMN::FlowNode *, auto_list< std::weak_ptr< Message > > > outbox
 Map holding messages sent from given node.
 
std::unordered_map< Token *, std::vector< Token * > > tokensAwaitingBoundaryEvent
 Map holding a container of all tokens at a boundary event awaiting to be triggered for each token at an activity.
 
std::unordered_map< Token *, Token * > tokenAssociatedToBoundaryEventToken
 Map holding the token residing at the associated activity for each token at a boundary event.
 
auto_set< BPMNOS::number, std::weak_ptr< Token > > tokensAwaitingTimer
 Sorted container holding holding all tokens awaiting a timer event.
 
std::unordered_map< BPMNOS::number, auto_list< std::weak_ptr< Token > > > tokensAwaitingSignal
 Map holding a container of all tokens at a signal event awaiting a signal with a given name.
 
std::unordered_map< BPMNOS::number, auto_list< std::weak_ptr< Token > > > tokensAwaitingCondition
 Map holding a container of all tokens at a conditional event belonginge to a process instance.
 
std::unordered_map< Token *, std::weak_ptr< Message > > messageAwaitingDelivery
 Container holding message awaiting delivery for tokens at send tasks.
 
std::unordered_map< Token *, Token * > tokenAtMultiInstanceActivity
 Map holding the main token waiting at a multi-instance (or loop) activity.
 
std::unordered_map< Token *, Token * > tokenAwaitingMultiInstanceExit
 Map holding the token waiting for the exit of an instantiation of a multi-instance (or loop) activity.
 
std::unordered_map< Token *, std::vector< Token * > > tokensAtActivityInstance
 Map holding all tokens representing an active instance of a multi-instance (or loop) activity for each token waiting at the multi-instance (or loop) activity.
 
std::unordered_map< Token *, std::vector< BPMNOS::Values > > exitStatusAtActivityInstance
 Map holding the exit status of all instances of a multi-instance (or loop) activity for each token waiting at the multi-instance (or loop) activity.
 
std::unordered_map< Token *, Token * > tokenAtEventBasedGateway
 Map holding the token at the relevant event-based gateway.
 
std::unordered_map< Token *, std::vector< Token * > > tokensAwaitingEvent
 Map holding all tokens at catching events subsequent to an event-based gateway.
 
std::unordered_map< StateMachine *, std::map< const BPMN::FlowNode *, std::vector< Token * > > > tokensAwaitingGatewayActivation
 Map holding tokens awaiting activation of a converging gateway.
 
std::unordered_map< Token *, Token * > tokenAwaitingCompensationActivity
 Map holding a token that waits for completion of another.
 
std::unordered_map< StateMachine *, Token * > tokenAwaitingCompensationEventSubProcess
 Map holding a token that waits for completion of an event subprocess.
 
BPMNOS::Values globals
 
StateMachines instances
 Container holding a state machine for each running instance.
 
Messages messages
 Container holding all messages created by a throwing message event.
 

Friends

class Engine
 
class StateMachine
 
class Token
 
class ConditionalEventObserver
 

Constructor & Destructor Documentation

◆ SystemState()

SystemState::SystemState ( const Engine * engine,
const BPMNOS::Model::Scenario * scenario,
BPMNOS::number currentTime = 0 )

Definition at line 7 of file SystemState.cpp.

◆ ~SystemState()

SystemState::~SystemState ( )

Definition at line 16 of file SystemState.cpp.

Member Function Documentation

◆ getDataAttributes()

std::optional< BPMNOS::Values > SystemState::getDataAttributes ( const StateMachine * root,
const BPMN::Node * node ) const

Definition at line 74 of file SystemState.cpp.

◆ getInstantiations()

std::vector< std::tuple< const BPMN::Process *, BPMNOS::Values, BPMNOS::Values > > SystemState::getInstantiations ( ) const

A vector representing an instantiation contains a reference to the process, the initial status, and the initial data attribute value

Definition at line 52 of file SystemState.cpp.

◆ getObjective()

BPMNOS::number SystemState::getObjective ( ) const

Global attributes are evaluated upon each call of the method.

Attributes declared for activities, event-subprocesses, and processes contribute to the objective when

  • the activity is exited,
  • a compensation activity is completed,
  • the event-subprocess shuts down without failure, or
  • the process shuts down without failure.

In all other cases values of attributes declared to contribute to the objective will be ignored.

Definition at line 38 of file SystemState.cpp.

◆ getStatusAttributes()

std::optional< BPMNOS::Values > SystemState::getStatusAttributes ( const StateMachine * root,
const BPMN::Node * node ) const

Definition at line 61 of file SystemState.cpp.

◆ getTime()

BPMNOS::number SystemState::getTime ( ) const

Definition at line 27 of file SystemState.cpp.

◆ isAlive()

bool SystemState::isAlive ( ) const

Definition at line 31 of file SystemState.cpp.

Friends And Related Symbol Documentation

◆ ConditionalEventObserver

friend class ConditionalEventObserver
friend

Definition at line 153 of file SystemState.h.

◆ Engine

friend class Engine
friend

Definition at line 150 of file SystemState.h.

◆ StateMachine

friend class StateMachine
friend

Definition at line 151 of file SystemState.h.

◆ Token

friend class Token
friend

Definition at line 152 of file SystemState.h.

Member Data Documentation

◆ archive

std::unordered_map< long unsigned int, std::weak_ptr<StateMachine> > BPMNOS::Execution::SystemState::archive

Definition at line 82 of file SystemState.h.

◆ assumedTime

std::optional<BPMNOS::number> BPMNOS::Execution::SystemState::assumedTime

Definition at line 42 of file SystemState.h.

◆ contributionsToObjective

BPMNOS::number BPMNOS::Execution::SystemState::contributionsToObjective

Definition at line 69 of file SystemState.h.

◆ currentTime

BPMNOS::number BPMNOS::Execution::SystemState::currentTime

Definition at line 37 of file SystemState.h.

◆ exitStatusAtActivityInstance

std::unordered_map< Token*, std::vector<BPMNOS::Values> > BPMNOS::Execution::SystemState::exitStatusAtActivityInstance

Definition at line 115 of file SystemState.h.

◆ globals

BPMNOS::Values BPMNOS::Execution::SystemState::globals

Definition at line 127 of file SystemState.h.

◆ inbox

std::unordered_map<StateMachine*, auto_list< std::weak_ptr<Message> > > BPMNOS::Execution::SystemState::inbox

Definition at line 92 of file SystemState.h.

◆ instances

StateMachines BPMNOS::Execution::SystemState::instances

Definition at line 132 of file SystemState.h.

◆ messageAwaitingDelivery

std::unordered_map< Token*, std::weak_ptr<Message> > BPMNOS::Execution::SystemState::messageAwaitingDelivery

Definition at line 110 of file SystemState.h.

◆ messages

Messages BPMNOS::Execution::SystemState::messages

Definition at line 137 of file SystemState.h.

◆ outbox

std::unordered_map<const BPMN::FlowNode*, auto_list< std::weak_ptr<Message> > > BPMNOS::Execution::SystemState::outbox

Definition at line 97 of file SystemState.h.

◆ pendingChoiceDecisions

auto_list< std::weak_ptr<Token>, std::weak_ptr<DecisionRequest> > BPMNOS::Execution::SystemState::pendingChoiceDecisions

Definition at line 72 of file SystemState.h.

◆ pendingEntryDecisions

auto_list< std::weak_ptr<Token>, std::weak_ptr<DecisionRequest> > BPMNOS::Execution::SystemState::pendingEntryDecisions

Definition at line 71 of file SystemState.h.

◆ pendingExitDecisions

auto_list< std::weak_ptr<Token>, std::weak_ptr<DecisionRequest> > BPMNOS::Execution::SystemState::pendingExitDecisions

Definition at line 73 of file SystemState.h.

◆ pendingMessageDeliveryDecisions

auto_list< std::weak_ptr<Token>, std::weak_ptr<DecisionRequest> > BPMNOS::Execution::SystemState::pendingMessageDeliveryDecisions

Definition at line 74 of file SystemState.h.

◆ scenario

const BPMNOS::Model::Scenario* BPMNOS::Execution::SystemState::scenario

Definition at line 32 of file SystemState.h.

◆ tokenAssociatedToBoundaryEventToken

std::unordered_map< Token*, Token* > BPMNOS::Execution::SystemState::tokenAssociatedToBoundaryEventToken

Definition at line 102 of file SystemState.h.

◆ tokenAtEventBasedGateway

std::unordered_map< Token*, Token* > BPMNOS::Execution::SystemState::tokenAtEventBasedGateway

Definition at line 117 of file SystemState.h.

◆ tokenAtMultiInstanceActivity

std::unordered_map< Token*, Token* > BPMNOS::Execution::SystemState::tokenAtMultiInstanceActivity

Definition at line 112 of file SystemState.h.

◆ tokenAwaitingCompensationActivity

std::unordered_map< Token*, Token* > BPMNOS::Execution::SystemState::tokenAwaitingCompensationActivity

Definition at line 124 of file SystemState.h.

◆ tokenAwaitingCompensationEventSubProcess

std::unordered_map< StateMachine*, Token* > BPMNOS::Execution::SystemState::tokenAwaitingCompensationEventSubProcess

Definition at line 125 of file SystemState.h.

◆ tokenAwaitingMultiInstanceExit

std::unordered_map< Token*, Token* > BPMNOS::Execution::SystemState::tokenAwaitingMultiInstanceExit

Definition at line 113 of file SystemState.h.

◆ tokensAtActivityInstance

std::unordered_map< Token*, std::vector<Token*> > BPMNOS::Execution::SystemState::tokensAtActivityInstance

Definition at line 114 of file SystemState.h.

◆ tokensAwaitingBoundaryEvent

std::unordered_map< Token*, std::vector<Token*> > BPMNOS::Execution::SystemState::tokensAwaitingBoundaryEvent

Definition at line 101 of file SystemState.h.

◆ tokensAwaitingCompletionEvent

auto_set< BPMNOS::number, std::weak_ptr<Token> > BPMNOS::Execution::SystemState::tokensAwaitingCompletionEvent

Definition at line 77 of file SystemState.h.

◆ tokensAwaitingCondition

std::unordered_map< BPMNOS::number, auto_list< std::weak_ptr<Token> > > BPMNOS::Execution::SystemState::tokensAwaitingCondition

Definition at line 108 of file SystemState.h.

◆ tokensAwaitingEvent

std::unordered_map< Token*, std::vector<Token*> > BPMNOS::Execution::SystemState::tokensAwaitingEvent

Definition at line 118 of file SystemState.h.

◆ tokensAwaitingGatewayActivation

std::unordered_map< StateMachine*, std::map<const BPMN::FlowNode*, std::vector<Token*> > > BPMNOS::Execution::SystemState::tokensAwaitingGatewayActivation

Definition at line 120 of file SystemState.h.

◆ tokensAwaitingReadyEvent

auto_list< std::weak_ptr<Token> > BPMNOS::Execution::SystemState::tokensAwaitingReadyEvent

Definition at line 76 of file SystemState.h.

◆ tokensAwaitingSignal

std::unordered_map< BPMNOS::number, auto_list< std::weak_ptr<Token> > > BPMNOS::Execution::SystemState::tokensAwaitingSignal

Definition at line 106 of file SystemState.h.

◆ tokensAwaitingTimer

auto_set<BPMNOS::number, std::weak_ptr<Token> > BPMNOS::Execution::SystemState::tokensAwaitingTimer

Definition at line 104 of file SystemState.h.

◆ unsent

std::unordered_map<long unsigned int, auto_list< std::weak_ptr<Message> > > BPMNOS::Execution::SystemState::unsent

Definition at line 87 of file SystemState.h.


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