18 auto message =
static_cast<const Message*
>(observable);
21 messages.emplace_back( message->weak_from_this() );
29 auto decision = std::make_shared<EntryDecision>(token,
evaluator);
30 auto reward = decision->evaluate();
31 if ( reward.has_value() ) {
39 auto decision = std::make_shared<ExitDecision>(token,
evaluator);
40 auto reward = decision->evaluate();
41 if ( reward.has_value() ) {
65 std::list< std::shared_ptr<const Message> > candidates;
69 for (
auto& [ message_ptr ] :
messages ) {
71 if(
auto message = message_ptr.lock();
73 std::ranges::contains(senderCandidates, message->origin) &&
74 message->matches(recipientHeader)
77 candidates.emplace_back( message );
82 std::shared_ptr<MessageDeliveryDecision> best =
nullptr;
83 for (
auto& message : candidates ) {
84 auto decision = std::make_shared<MessageDeliveryDecision>(token, message.get(),
evaluator);
85 auto reward = decision->evaluate();
88 ( !best || best->reward.value() < reward.value() )
Represents an abstract base class for an evaluator determining feasibility and reward of a decision.
Represents a graph containing all BPMN nodes that may receive a token during execution of a scenario.
A controller dispatching decisions in the order derived from a given seed.
void notice(const Observable *observable) override
void notice(const Observable *observable) override
auto_list< std::weak_ptr< const Message > > messages
std::unique_ptr< BisectionalChoice > choiceDispatcher
std::shared_ptr< Event > createChoiceEvent(const SystemState *systemState, const Token *token, const Vertex *vertex) override
Method creating a choice event.
std::shared_ptr< Event > createEntryEvent(const SystemState *systemState, const Token *token, const Vertex *vertex) override
Method creating an initial sequence of vertices.
SeededGreedyController(const BPMNOS::Execution::FlattenedGraph *flattenedGraph, Evaluator *evaluator)
std::shared_ptr< Event > createExitEvent(const SystemState *systemState, const Token *token, const Vertex *vertex) override
Method creating a choice event.
std::shared_ptr< Event > createMessageDeliveryEvent(const SystemState *systemState, const Token *token, const Vertex *vertex) override
Method creating a choice event.
A class representing the state that the execution or simulation of a given scenario is in.
Represents a token running through a (sub)process.
const BPMN::FlowNode * node
const BPMNOS::Model::AttributeRegistry & getAttributeRegistry() const
SharedValues * data
Pointer to the data of the owner or owned state machine subprocesses)
std::shared_ptr< DecisionRequest > decisionRequest
Class holding extension elements representing execution data for nodes.
std::unique_ptr< ExtensionElements > extensionElements
T * represents()
Attempts to cast the element to the specified type T.
virtual constexpr Type getObservableType() const =0