1#ifndef BPMNOS_Execution_CPController_H
2#define BPMNOS_Execution_CPController_H
10#include <unordered_map>
101 template <
class T1,
class T2>
103 auto h1 = std::hash<T1>{}(p.first);
104 auto h2 = std::hash<T2>{}(p.second);
115 std::unordered_map< const Vertex*, const CP::Variable& >
position;
116 std::unordered_map< const Vertex*, const CP::Variable& >
visit;
118 std::unordered_map< std::pair< const Vertex*, const Vertex* >,
const CP::Variable&,
pair_hash >
tokenFlow;
121 std::vector< IndexedAttributeVariables >
globals;
122 std::unordered_map< const Vertex*, const CP::Variable& >
globalIndex;
124 std::unordered_map< const Vertex*, std::vector< IndexedAttributeVariables > >
data;
125 std::unordered_map< const Vertex*, std::vector< CP::reference_vector< const CP::Variable > > >
dataIndex;
127 std::unordered_map< const Vertex*, std::vector<AttributeVariables> >
status;
128 std::unordered_map< std::pair< const Vertex*, const Vertex* >, std::vector<AttributeVariables>,
pair_hash >
statusFlow;
130 std::unordered_map< const Vertex*, std::vector< std::tuple< std::string_view, size_t, AttributeVariables> > >
messageContent;
A controller dispatching decisions obtained from a solution of a constraint program.
std::vector< std::reference_wrapper< const Vertex > > getReachableVertices(const Vertex &initialVertex)
std::unordered_map< const Vertex *, const CP::Variable & > visit
Variables holding sequence positions for all vertices.
std::unordered_map< const Vertex *, const CP::Variable & > globalIndex
Variables representing global attributes after i-th modification.
void createEntryVariables(const Vertex &vertex)
void connect(Mediator *mediator)
std::unordered_map< const Vertex *, const CP::Variable & > position
Container of all vertices catching a message.
void createGlobalVariables()
Method creating the constraint program.
std::shared_ptr< Event > dispatchEvent(const SystemState *systemState)
const BPMNOS::Model::Scenario * scenario
std::unordered_map< std::pair< const Vertex *, const Vertex * >, std::vector< AttributeVariables >, pair_hash > statusFlow
Variables representing status attributes of a vertex.
void createEntryStatus(const Vertex &vertex)
std::unordered_map< const Vertex *, std::vector< CP::reference_vector< const CP::Variable > > > dataIndex
Variables representing data attributes owned by an entry vertex after i-th modification.
void createGlobalIndexVariable(const Vertex &vertex)
std::unordered_map< const Vertex *, std::vector< AttributeVariables > > status
Variables representing an index representing the state of the data attributes for each data owner.
std::unordered_map< const Vertex *, std::vector< IndexedAttributeVariables > > data
Variables representing an index representing the state of the global attributes.
void createDataIndexVariables(const Vertex &vertex)
CPController(const BPMNOS::Model::Scenario *scenario)
void createVertexVariables(const Vertex &vertex)
void createMessageContent(const Vertex &vertex)
std::vector< IndexedAttributeVariables > globals
Variables indicating whether the a token flows from one vertex to another.
std::vector< const Vertex * > messageRecipients
Container of all vertices considered.
std::vector< AttributeVariables > createMergedStatus(const Vertex &vertex, const BPMNOS::Model::AttributeRegistry &attributeRegistry, std::vector< std::pair< const CP::Variable &, std::vector< AttributeVariables > & > > inputs)
void createExitVariables(const Vertex &vertex)
std::unordered_map< const Vertex *, std::vector< std::tuple< std::string_view, size_t, AttributeVariables > > > messageContent
Variables representing status attributes flowing from one vertex to another.
void createSequenceConstraints(const Vertex &vertex)
std::unordered_map< std::pair< const Vertex *, const Vertex * >, const CP::Variable &, pair_hash > messageFlow
Variables indicating whether the a token flows from one vertex to another.
const CP::Model & getModel()
std::vector< AttributeVariables > createAlternativeEntryStatus(const Vertex &vertex, const BPMNOS::Model::AttributeRegistry &attributeRegistry, std::vector< std::pair< const CP::Variable &, std::vector< AttributeVariables > & > > alternatives)
void initializeVertices(const Vertex &initialVertex)
Returns a topologically sorted vector of all vertices reachable from the given vertex.
void createMessageVariables()
std::unordered_map< std::pair< const Vertex *, const Vertex * >, const CP::Variable &, pair_hash > tokenFlow
Variables indicating whether the a token enters or leaves a vertex.
void createDataVariables(const Vertex &vertex)
void createStatus(const Vertex &vertex)
void createExitStatus(const Vertex &vertex)
const FlattenedGraph flattenedGraph
std::vector< const Vertex * > vertices
Base class for an execution controller which dispatches events to the engine and listens to notificat...
Represents an abstract base class for a pending Evaluator.
Represents a graph containing all BPMN nodes that may receive a token during execution of a scenario.
A class representing the state that the execution or simulation of a given scenario is in.
The Scenario class holds data for all BPMN instances.
const CP::Variable & defined
AttributeVariables operator=(const AttributeVariables &other)
AttributeVariables(const CP::Variable &defined, const CP::Variable &value)
AttributeVariables(const AttributeVariables &other)
const CP::Variable & value
CP::IndexedVariables & defined
CP::IndexedVariables & value
std::size_t operator()(const std::pair< T1, T2 > &p) const