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

A controller dispatching decisions in the order derived from a given seed. More...

Detailed Description

Definition at line 28 of file SeededController.h.

#include <SeededController.h>

Inheritance diagram for BPMNOS::Execution::SeededController:

Classes

struct  Config
 
struct  pair_hash
 Map holding the entry vertex of a sequential activity performed by a sequential performer. More...
 

Public Types

using Vertex = FlattenedGraph::Vertex
 
using RequestType = Observable::Type
 

Public Member Functions

 SeededController (const BPMNOS::Execution::FlattenedGraph *flattenedGraph, Config config=default_config())
 
bool setSeed (const std::vector< size_t > initialSeed)
 
void connect (Mediator *mediator)
 
void subscribe (Engine *engine)
 
void notice (const Observable *observable) override
 
void synchronizeSolution (const Token *token)
 
std::vector< size_t > getSequence () const
 Method return true if a token entering a catch event node may be withdrawn.
 
size_t getProgress () const
 Method providing the vertex sequence in the solution.
 
void initializePendingVertices ()
 Method returning the number of processed vertices.
 
virtual std::shared_ptr< EventcreateEntryEvent (const SystemState *systemState, const Token *token, const Vertex *vertex)=0
 Method creating an initial sequence of vertices.
 
virtual std::shared_ptr< EventcreateExitEvent (const SystemState *systemState, const Token *token, const Vertex *vertex)=0
 Method creating a choice event.
 
virtual std::shared_ptr< EventcreateChoiceEvent (const SystemState *systemState, const Token *token, const Vertex *vertex)=0
 Method creating a choice event.
 
virtual std::shared_ptr< EventcreateMessageDeliveryEvent (const SystemState *systemState, const Token *token, const Vertex *vertex)=0
 Method creating a choice event.
 
const Vertexentry (const Vertex *vertex) const
 Method creating a message delivery event.
 
const Vertexexit (const Vertex *vertex) const
 
- Public Member Functions inherited from BPMNOS::Execution::Controller
 Controller ()
 
virtual ~Controller ()=default
 
- 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)
 
template<typename... ObservableTypes>
void removeSubscriber (Observer *subscriber, ObservableTypes... observableTypes)
 
void notify (const Observable *observable) const
 
void notify (const Observable &observable) const
 

Static Public Member Functions

static Config default_config ()
 

Public Attributes

const FlattenedGraphflattenedGraph
 

Protected Member Functions

std::shared_ptr< EventdispatchEvent (const SystemState *systemState)
 
bool hasPendingPredecessor (const Vertex *vertex) const
 The list of vertices already processed.
 
bool hasPendingRecipient (const Vertex *vertex) const
 
void finalizePredecessorPositions (const Vertex *vertex)
 
void fetchPendingPredecessors (std::unordered_set< const Vertex * > &predecessors, const Vertex *vertex) const
 
std::list< constVertex * >::iterator finalizeVertexPosition (const Vertex *vertex)
 
std::list< constVertex * >::iterator finalizeUnvisited (const Vertex *vertex)
 Method finalizing the sequence position of a pending vertex and removing it from the list.
 
void finalizeUnvisitedChildren (const Vertex *vertex)
 
std::list< constVertex * >::iterator finalizeUnvisitedTypedStartEvents (std::list< const Vertex * >::iterator it)
 
bool withdrawableEntry (const BPMN::Node *node) const
 Method finalizing the sequence position of a unvisited vertices belonging to typed start events.
 
- Protected Member Functions inherited from BPMNOS::Execution::EventListener
std::shared_ptr< EventfetchEvent (SystemState *systemState)
 

Protected Attributes

Evaluatorevaluator
 
std::shared_ptr< TerminationEventterminationEvent
 
Config config
 
std::vector< size_t > seed
 
std::unordered_map< const Vertex *, const Vertex * > performing
 
std::list< const Vertex * > pendingVertices
 
std::list< const Vertex * > processedVertices
 The list of vertices to be processed.
 
- Protected Attributes inherited from BPMNOS::Execution::EventListener
std::vector< EventDispatcher * > eventDispatchers
 

Member Typedef Documentation

◆ RequestType

◆ Vertex

Constructor & Destructor Documentation

◆ SeededController()

SeededController::SeededController ( const BPMNOS::Execution::FlattenedGraph * flattenedGraph,
Config config = default_config() )

Definition at line 12 of file SeededController.cpp.

Member Function Documentation

◆ connect()

void SeededController::connect ( Mediator * mediator)
virtual

Reimplemented from BPMNOS::Execution::Controller.

Definition at line 23 of file SeededController.cpp.

◆ createChoiceEvent()

virtual std::shared_ptr< Event > BPMNOS::Execution::SeededController::createChoiceEvent ( const SystemState * systemState,
const Token * token,
const Vertex * vertex )
pure virtual

◆ createEntryEvent()

virtual std::shared_ptr< Event > BPMNOS::Execution::SeededController::createEntryEvent ( const SystemState * systemState,
const Token * token,
const Vertex * vertex )
pure virtual

◆ createExitEvent()

virtual std::shared_ptr< Event > BPMNOS::Execution::SeededController::createExitEvent ( const SystemState * systemState,
const Token * token,
const Vertex * vertex )
pure virtual

◆ createMessageDeliveryEvent()

virtual std::shared_ptr< Event > BPMNOS::Execution::SeededController::createMessageDeliveryEvent ( const SystemState * systemState,
const Token * token,
const Vertex * vertex )
pure virtual

◆ default_config()

static Config BPMNOS::Execution::SeededController::default_config ( )
inlinestatic

Definition at line 37 of file SeededController.h.

◆ dispatchEvent()

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

Implements BPMNOS::Execution::EventDispatcher.

Definition at line 406 of file SeededController.cpp.

◆ entry()

const Vertex * BPMNOS::Execution::SeededController::entry ( const Vertex * vertex) const
inline

Definition at line 91 of file SeededController.h.

◆ exit()

const Vertex * BPMNOS::Execution::SeededController::exit ( const Vertex * vertex) const
inline

Definition at line 92 of file SeededController.h.

◆ fetchPendingPredecessors()

void SeededController::fetchPendingPredecessors ( std::unordered_set< const Vertex * > & predecessors,
const Vertex * vertex ) const
protected

Definition at line 57 of file SeededController.cpp.

◆ finalizePredecessorPositions()

void SeededController::finalizePredecessorPositions ( const Vertex * vertex)
protected

Definition at line 75 of file SeededController.cpp.

◆ finalizeUnvisited()

std::list< constSeededController::Vertex * >::iterator SeededController::finalizeUnvisited ( const Vertex * vertex)
protected

Definition at line 132 of file SeededController.cpp.

◆ finalizeUnvisitedChildren()

void SeededController::finalizeUnvisitedChildren ( const Vertex * vertex)
protected

Definition at line 109 of file SeededController.cpp.

◆ finalizeUnvisitedTypedStartEvents()

std::list< constSeededController::Vertex * >::iterator SeededController::finalizeUnvisitedTypedStartEvents ( std::list< const Vertex * >::iterator it)
protected

Definition at line 371 of file SeededController.cpp.

◆ finalizeVertexPosition()

std::list< constSeededController::Vertex * >::iterator SeededController::finalizeVertexPosition ( const Vertex * vertex)
protected

Definition at line 43 of file SeededController.cpp.

◆ getProgress()

size_t SeededController::getProgress ( ) const

Definition at line 634 of file SeededController.cpp.

◆ getSequence()

std::vector< size_t > SeededController::getSequence ( ) const

Definition at line 615 of file SeededController.cpp.

◆ hasPendingPredecessor()

bool SeededController::hasPendingPredecessor ( const Vertex * vertex) const
protected

Definition at line 335 of file SeededController.cpp.

◆ hasPendingRecipient()

bool SeededController::hasPendingRecipient ( const Vertex * vertex) const
protected

Definition at line 395 of file SeededController.cpp.

◆ initializePendingVertices()

void SeededController::initializePendingVertices ( )

Definition at line 299 of file SeededController.cpp.

◆ notice()

void SeededController::notice ( const Observable * observable)
overridevirtual

Reimplemented from BPMNOS::Execution::Controller.

Reimplemented in BPMNOS::Execution::SeededGreedyController.

Definition at line 277 of file SeededController.cpp.

◆ setSeed()

bool SeededController::setSeed ( const std::vector< size_t > initialSeed)

Definition at line 33 of file SeededController.cpp.

◆ subscribe()

void SeededController::subscribe ( Engine * engine)

Definition at line 27 of file SeededController.cpp.

◆ synchronizeSolution()

void SeededController::synchronizeSolution ( const Token * token)

Definition at line 159 of file SeededController.cpp.

◆ withdrawableEntry()

bool SeededController::withdrawableEntry ( const BPMN::Node * node) const
protected

Definition at line 357 of file SeededController.cpp.

Member Data Documentation

◆ config

Config BPMNOS::Execution::SeededController::config
protected

Definition at line 49 of file SeededController.h.

◆ evaluator

Evaluator* BPMNOS::Execution::SeededController::evaluator
protected

Definition at line 46 of file SeededController.h.

◆ flattenedGraph

const FlattenedGraph* BPMNOS::Execution::SeededController::flattenedGraph

Definition at line 51 of file SeededController.h.

◆ pendingVertices

std::list< const Vertex* > BPMNOS::Execution::SeededController::pendingVertices
protected

Definition at line 70 of file SeededController.h.

◆ performing

std::unordered_map< const Vertex*, const Vertex* > BPMNOS::Execution::SeededController::performing
protected

Definition at line 54 of file SeededController.h.

◆ processedVertices

std::list< const Vertex* > BPMNOS::Execution::SeededController::processedVertices
protected

Definition at line 71 of file SeededController.h.

◆ seed

std::vector<size_t> BPMNOS::Execution::SeededController::seed
protected

Definition at line 53 of file SeededController.h.

◆ terminationEvent

std::shared_ptr<TerminationEvent> BPMNOS::Execution::SeededController::terminationEvent
protected

Definition at line 47 of file SeededController.h.


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