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

A controller dispatching decisions obtained from a solution of a constraint program. More...

Detailed Description

Definition at line 23 of file CPController.h.

#include <CPController.h>

Inheritance diagram for BPMNOS::Execution::CPController:

Classes

struct  AttributeVariables
 
struct  IndexedAttributeVariables
 
struct  pair_hash
 

Public Member Functions

 CPController (const BPMNOS::Model::Scenario *scenario)
 
void connect (Mediator *mediator)
 
const CP::Model & getModel ()
 
- Public Member Functions inherited from BPMNOS::Execution::Controller
 Controller ()
 
virtual ~Controller ()=default
 
void notice (const Observable *observable) override
 
- Public Member Functions inherited from BPMNOS::Execution::Observer
- Public Member Functions inherited from BPMNOS::Execution::EventDispatcher
virtual ~EventDispatcher ()=default
 
virtual void notice (Event *event)
 
- 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

std::shared_ptr< EventdispatchEvent (const SystemState *systemState)
 
void createCP ()
 
void createGlobalVariables ()
 Method creating the constraint program.
 
void createMessageVariables ()
 
void createMessageContent (const Vertex &vertex)
 
std::vector< std::reference_wrapper< const Vertex > > getReachableVertices (const Vertex &initialVertex)
 
void initializeVertices (const Vertex &initialVertex)
 Returns a topologically sorted vector of all vertices reachable from the given vertex.
 
void createVertexVariables (const Vertex &vertex)
 
void createEntryVariables (const Vertex &vertex)
 
void createExitVariables (const Vertex &vertex)
 
void createSequenceConstraints (const Vertex &vertex)
 
void createGlobalIndexVariable (const Vertex &vertex)
 
void createDataVariables (const Vertex &vertex)
 
void createDataIndexVariables (const Vertex &vertex)
 
void createStatus (const Vertex &vertex)
 
void createEntryStatus (const Vertex &vertex)
 
void createExitStatus (const Vertex &vertex)
 
std::vector< AttributeVariablescreateAlternativeEntryStatus (const Vertex &vertex, const BPMNOS::Model::AttributeRegistry &attributeRegistry, std::vector< std::pair< const CP::Variable &, std::vector< AttributeVariables > & > > alternatives)
 
std::vector< AttributeVariablescreateMergedStatus (const Vertex &vertex, const BPMNOS::Model::AttributeRegistry &attributeRegistry, std::vector< std::pair< const CP::Variable &, std::vector< AttributeVariables > & > > inputs)
 
- Protected Member Functions inherited from BPMNOS::Execution::EventListener
std::shared_ptr< EventfetchEvent (SystemState *systemState)
 

Protected Attributes

Evaluatorevaluator
 
const BPMNOS::Model::Scenarioscenario
 
const FlattenedGraph flattenedGraph
 
CP::Model model
 
std::vector< const Vertex * > vertices
 
std::vector< const Vertex * > messageRecipients
 Container of all vertices considered.
 
std::unordered_map< const Vertex *, const CP::Variable & > position
 Container of all vertices catching a message.
 
std::unordered_map< const Vertex *, const CP::Variable & > visit
 Variables holding sequence positions for all vertices.
 
std::unordered_map< std::pair< const Vertex *, const Vertex * >, const CP::Variable &, pair_hashtokenFlow
 Variables indicating whether the a token enters or leaves a vertex.
 
std::unordered_map< std::pair< const Vertex *, const Vertex * >, const CP::Variable &, pair_hashmessageFlow
 Variables indicating whether the a token flows from one vertex to another.
 
std::vector< IndexedAttributeVariablesglobals
 Variables indicating whether the a token flows from one vertex to another.
 
std::unordered_map< const Vertex *, const CP::Variable & > globalIndex
 Variables representing global attributes after i-th modification.
 
std::unordered_map< const Vertex *, std::vector< IndexedAttributeVariables > > data
 Variables representing an index representing the state of the global attributes.
 
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.
 
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< std::pair< const Vertex *, const Vertex * >, std::vector< AttributeVariables >, pair_hashstatusFlow
 Variables representing status attributes of a 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.
 
- Protected Attributes inherited from BPMNOS::Execution::EventListener
std::vector< EventDispatcher * > eventDispatchers
 

Constructor & Destructor Documentation

◆ CPController()

CPController::CPController ( const BPMNOS::Model::Scenario * scenario)

Definition at line 9 of file CPController.cpp.

Member Function Documentation

◆ connect()

void CPController::connect ( Mediator * mediator)
virtual

Reimplemented from BPMNOS::Execution::Controller.

Definition at line 17 of file CPController.cpp.

◆ createAlternativeEntryStatus()

std::vector< CPController::AttributeVariables > CPController::createAlternativeEntryStatus ( const Vertex & vertex,
const BPMNOS::Model::AttributeRegistry & attributeRegistry,
std::vector< std::pair< const CP::Variable &, std::vector< AttributeVariables > & > > alternatives )
protected

Definition at line 397 of file CPController.cpp.

◆ createCP()

void CPController::createCP ( )
protected

Definition at line 27 of file CPController.cpp.

◆ createDataIndexVariables()

void CPController::createDataIndexVariables ( const Vertex & vertex)
protected

Definition at line 663 of file CPController.cpp.

◆ createDataVariables()

void CPController::createDataVariables ( const Vertex & vertex)
protected

CAN I MOVE THIS; SHOULD THIS BE REFERENCES?

Definition at line 144 of file CPController.cpp.

◆ createEntryStatus()

void CPController::createEntryStatus ( const Vertex & vertex)
protected

Definition at line 201 of file CPController.cpp.

◆ createEntryVariables()

void CPController::createEntryVariables ( const Vertex & vertex)
protected

Definition at line 545 of file CPController.cpp.

◆ createExitStatus()

void CPController::createExitStatus ( const Vertex & vertex)
protected

Definition at line 273 of file CPController.cpp.

◆ createExitVariables()

void CPController::createExitVariables ( const Vertex & vertex)
protected

Definition at line 582 of file CPController.cpp.

◆ createGlobalIndexVariable()

void CPController::createGlobalIndexVariable ( const Vertex & vertex)
protected

Definition at line 653 of file CPController.cpp.

◆ createGlobalVariables()

void CPController::createGlobalVariables ( )
protected

Definition at line 57 of file CPController.cpp.

◆ createMergedStatus()

std::vector< CPController::AttributeVariables > CPController::createMergedStatus ( const Vertex & vertex,
const BPMNOS::Model::AttributeRegistry & attributeRegistry,
std::vector< std::pair< const CP::Variable &, std::vector< AttributeVariables > & > > inputs )
protected

Definition at line 420 of file CPController.cpp.

◆ createMessageContent()

void CPController::createMessageContent ( const Vertex & vertex)
protected

Definition at line 136 of file CPController.cpp.

◆ createMessageVariables()

void CPController::createMessageVariables ( )
protected

Definition at line 95 of file CPController.cpp.

◆ createSequenceConstraints()

void CPController::createSequenceConstraints ( const Vertex & vertex)
protected

Definition at line 624 of file CPController.cpp.

◆ createStatus()

void CPController::createStatus ( const Vertex & vertex)
protected

Definition at line 189 of file CPController.cpp.

◆ createVertexVariables()

void CPController::createVertexVariables ( const Vertex & vertex)
protected

Definition at line 515 of file CPController.cpp.

◆ dispatchEvent()

std::shared_ptr< Event > CPController::dispatchEvent ( const SystemState * systemState)
protectedvirtual

Implements BPMNOS::Execution::EventDispatcher.

Definition at line 21 of file CPController.cpp.

◆ getModel()

const CP::Model & BPMNOS::Execution::CPController::getModel ( )
inline

Definition at line 29 of file CPController.h.

◆ getReachableVertices()

std::vector< std::reference_wrapper< const FlattenedGraph::Vertex > > CPController::getReachableVertices ( const Vertex & initialVertex)
protected

Definition at line 464 of file CPController.cpp.

◆ initializeVertices()

void CPController::initializeVertices ( const Vertex & initialVertex)
protected

Definition at line 509 of file CPController.cpp.

Member Data Documentation

◆ data

std::unordered_map< const Vertex*, std::vector< IndexedAttributeVariables > > BPMNOS::Execution::CPController::data
protected

Definition at line 124 of file CPController.h.

◆ dataIndex

std::unordered_map< const Vertex*, std::vector< CP::reference_vector< const CP::Variable > > > BPMNOS::Execution::CPController::dataIndex
protected

Definition at line 125 of file CPController.h.

◆ evaluator

Evaluator* BPMNOS::Execution::CPController::evaluator
protected

Definition at line 31 of file CPController.h.

◆ flattenedGraph

const FlattenedGraph BPMNOS::Execution::CPController::flattenedGraph
protected

Definition at line 35 of file CPController.h.

◆ globalIndex

std::unordered_map< const Vertex*, const CP::Variable& > BPMNOS::Execution::CPController::globalIndex
protected

Definition at line 122 of file CPController.h.

◆ globals

std::vector< IndexedAttributeVariables > BPMNOS::Execution::CPController::globals
protected

Definition at line 121 of file CPController.h.

◆ messageContent

std::unordered_map< const Vertex*, std::vector< std::tuple< std::string_view, size_t, AttributeVariables> > > BPMNOS::Execution::CPController::messageContent
protected

Definition at line 130 of file CPController.h.

◆ messageFlow

std::unordered_map< std::pair< const Vertex*, const Vertex* >, const CP::Variable&, pair_hash > BPMNOS::Execution::CPController::messageFlow
protected

Definition at line 119 of file CPController.h.

◆ messageRecipients

std::vector<const Vertex*> BPMNOS::Execution::CPController::messageRecipients
protected

Definition at line 113 of file CPController.h.

◆ model

CP::Model BPMNOS::Execution::CPController::model
protected

Definition at line 36 of file CPController.h.

◆ position

std::unordered_map< const Vertex*, const CP::Variable& > BPMNOS::Execution::CPController::position
protected

Definition at line 115 of file CPController.h.

◆ scenario

const BPMNOS::Model::Scenario* BPMNOS::Execution::CPController::scenario
protected

Definition at line 33 of file CPController.h.

◆ status

std::unordered_map< const Vertex*, std::vector<AttributeVariables> > BPMNOS::Execution::CPController::status
protected

Definition at line 127 of file CPController.h.

◆ statusFlow

std::unordered_map< std::pair< const Vertex*, const Vertex* >, std::vector<AttributeVariables>, pair_hash > BPMNOS::Execution::CPController::statusFlow
protected

Definition at line 128 of file CPController.h.

◆ tokenFlow

std::unordered_map< std::pair< const Vertex*, const Vertex* >, const CP::Variable&, pair_hash > BPMNOS::Execution::CPController::tokenFlow
protected

Definition at line 118 of file CPController.h.

◆ vertices

std::vector<const Vertex*> BPMNOS::Execution::CPController::vertices
protected

Definition at line 112 of file CPController.h.

◆ visit

std::unordered_map< const Vertex*, const CP::Variable& > BPMNOS::Execution::CPController::visit
protected

Definition at line 116 of file CPController.h.


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