11 auto token = decision->
token;
12 assert( token->ready() );
14 assert(extensionElements);
17 extensionElements->computeInitialValues(token->owner->systemState->getTime(),status,data,globals);
21assert(!
"No entry for event-subprocesses");
23 extensionElements->applyOperators(status,data,globals);
26 if ( !extensionElements->feasibleEntry(status,data,globals) ) {
39 extensionElements->applyOperators(status,data,globals);
45 auto token = decision->
token;
46 assert( token->completed() );
49 auto now = token->owner->systemState->getTime();
55 assert(extensionElements);
57 if ( !extensionElements->feasibleExit(status,data,globals) ) {
66 auto token = decision->
token;
73 assert(extensionElements);
74 extensionElements->applyOperators(status,data,globals);
76 if ( !extensionElements->fullScopeRestrictionsSatisfied(status,data,globals) ) {
85 auto token = decision->
token;
92 assert(extensionElements);
95 message->apply(token->node,token->getAttributeRegistry(),status,data,globals);
96 extensionElements->applyOperators(status,data,globals);
99 if ( !extensionElements->fullScopeRestrictionsSatisfied(status,data,globals) ) {
108 auto token = decision->
token;
109 assert( token->ready() );
111 assert(extensionElements);
112 Values status = token->status;
114 Values data(*token->data);
115 Values globals = token->globals;
116 double evaluation = (double)extensionElements->getObjective(status,data,globals);
119 bool feasible =
updateValues(decision,status,data,globals);
125 return evaluation - extensionElements->getObjective(status,data,globals);
129 auto token = decision->
token;
130 assert( token->completed() );
131 Values status = token->status;
133 Values data(*token->data);
134 Values globals = token->globals;
135 bool feasible =
updateValues(decision,status,data,globals);
143 auto token = decision->
token;
144 assert( token->busy() );
146 assert(extensionElements);
147 assert( extensionElements->choices.size() == decision->
choices.size() );
148 auto evaluation = (double)extensionElements->getObjective(token->status, *token->data, token->globals);
150 assert(
dynamic_cast<const ChoiceEvent*
>(decision) );
151 Values status(token->status);
153 Values data(*token->data);
154 Values globals = token->globals;
156 for (
size_t i = 0; i < extensionElements->choices.size(); i++) {
157 extensionElements->attributeRegistry.setValue( extensionElements->choices[i]->attribute, status, data, globals, decision->
choices[i] );
160 bool feasible =
updateValues(decision,status,data,globals);
165 return evaluation - extensionElements->getObjective(status,data,globals);
169 auto token = decision->
token;
170 assert( token->busy() );
173 assert(extensionElements);
174 Values status = token->status;
176 Values data(*token->data);
177 Values globals = token->globals;
178 double evaluation = (double)extensionElements->getObjective(status,data,globals);
180 bool feasible =
updateValues(decision,status,data,globals);
185 return evaluation - extensionElements->getObjective(status,data,globals);
190 std::set<const BPMNOS::Model::Attribute*> dependencies;
192 auto token = decision->
token;
194 assert(extensionElements);
200 dependencies.insert(extensionElements->operatorDependencies.begin(), extensionElements->operatorDependencies.end());
203 dependencies.insert(extensionElements->entryDependencies.begin(), extensionElements->entryDependencies.end());
209 dependencies.insert(extensionElements->operatorDependencies.begin(), extensionElements->operatorDependencies.end());
216 std::set<const BPMNOS::Model::Attribute*> dependencies;
218 auto token = decision->
token;
220 assert(extensionElements);
222 dependencies.insert(extensionElements->exitDependencies.begin(), extensionElements->exitDependencies.end());
228 auto token = decision->
token;
230 assert(extensionElements);
232 std::set<const BPMNOS::Model::Attribute*> dependencies = extensionElements->operatorDependencies;
235 for (
auto& choice : extensionElements->choices ) {
236 dependencies.insert(choice->dependencies.begin(), choice->dependencies.end());
243 std::set<const BPMNOS::Model::Attribute*> dependencies;
244 auto token = decision->
token;
248 assert(extensionElements);
249 dependencies.insert(extensionElements->operatorDependencies.begin(), extensionElements->operatorDependencies.end());
252 auto eventSubProcess = token->node->parent;
254 assert(extensionElements);
255 dependencies.insert(extensionElements->entryDependencies.begin(), extensionElements->entryDependencies.end());
256 dependencies.insert(extensionElements->operatorDependencies.begin(), extensionElements->operatorDependencies.end());
std::set< const BPMNOS::Model::Attribute * > getDependencies(EntryDecision *decision) override
virtual bool updateValues(EntryDecision *decision, Values &status, Values &data, Values &globals)
std::optional< double > evaluate(EntryDecision *decision) override
const SystemState * systemState
BPMNOS::number getTime() const
Function returning the assumed time time if available or the current time otherwise.
const BPMN::FlowNode * node
const StateMachine * owner
State machine owning the token.
Class representing a task in which one or more choices have to be made.
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.
Represents the event that choices are made for a DecisionTask.
Represents the event that choices are made for a DecisionTask.
Represents the event of a token entering a node.
Represents the event of a token exiting a node.
Represents the event of a message from the message pool being delivered.
Represents the event of a message from the message pool being delivered.
static constexpr size_t Timestamp