12 #include "../../AlgsExecutionStates.h"
38 result = dataNode->accept( *
this );
69 for (
auto algoNode : producers ) {
71 if ( AState::EVTACCEPTED ==
state || AState::EVTREJECTED ==
state ) {
96 for (
auto condAlg : node.
getProducers() ) condAlg->accept( promoter );
112 else if ( AState::EVTACCEPTED ==
state )
113 decision = !node.
isLiar();
114 else if ( AState::EVTREJECTED ==
state )
117 if ( -1 != decision ) {
123 for (
auto& consumer :
output->getConsumers() ) consumer->accept( promoter );
128 if ( parents.size() == 1 ) {
129 parents[0]->accept( vis );
132 for (
auto& p : parents ) {
134 if ( scout.reply() ) p->accept( vis );
139 for (
auto& p : parents ) {
141 if ( scout.reply() ) p->accept( vis );
162 bool foundNonResolvedChild =
false;
163 bool foundNegativeChild =
false;
164 bool foundPositiveChild =
false;
177 bool breakout =
false;
178 for (
unsigned int slotIndex : searchResult->second ) {
187 if ( childDecision == -1 )
188 foundNonResolvedChild =
true;
189 else if ( childDecision == 1 )
190 foundPositiveChild =
true;
192 foundNegativeChild =
true;
195 if ( node.
m_modeOR && foundPositiveChild ) {
199 }
else if ( !node.
m_modeOR && foundNegativeChild ) {
205 if ( foundNonResolvedChild ) {
214 if ( breakout )
break;
220 if ( childDecision == -1 )
221 foundNonResolvedChild =
true;
222 else if ( childDecision == 1 )
223 foundPositiveChild =
true;
225 foundNegativeChild =
true;
228 if ( node.
m_modeOR && foundPositiveChild ) {
231 }
else if ( !node.
m_modeOR && foundNegativeChild ) {
236 if ( foundNonResolvedChild )
break;
241 if ( !foundNonResolvedChild && decision == -1 ) {
243 if ( foundPositiveChild )
248 if ( foundNegativeChild )
260 if ( node.
m_allPass && !foundNonResolvedChild ) decision = 1;
262 if ( decision != -1 ) {
272 if ( scout.reply() ) p->accept( *
this );
279 if ( scout.reply() ) p->accept( *
this );
284 if ( oldSlot )
m_slot = oldSlot;
291 for (
unsigned int slotIndex : searchResult->second ) {
297 bool result = child->accept( *
this );
310 bool result = child->accept( *
this );
319 if ( oldSlot )
m_slot = oldSlot;
339 if ( AState::INITIAL ==
state ) states.set( node.
getAlgoIndex(), AState::CONTROLREADY ).ignore();
342 if ( AState::CONTROLREADY ==
state ) {
344 result = promoter.visit( node );
364 bool allChildDecisionsResolved =
true;
368 child->accept( *
this );
371 if ( childDecision == -1 ) allChildDecisionsResolved =
false;
380 for (
auto parent : node.
m_parents ) { parent->accept( *
this ); }
385 if ( allChildDecisionsResolved ) {
389 for (
auto parent : node.
m_parents ) { parent->accept( *
this ); }
392 return allChildDecisionsResolved;
411 states.set( node.
getAlgoIndex(), AState::CONTROLREADY ).ignore( );
412 if ( dataPromoter.visit( node ) ) {
413 states.set( node.
getAlgoIndex(), AState::SCHEDULED ).ignore( );
414 states.set( node.
getAlgoIndex(), AState::EVTACCEPTED ).ignore( );
420 }
else if ( AState::CONTROLREADY == states[node.
getAlgoIndex()] && dataPromoter.visit( node ) ) {
421 states.set( node.
getAlgoIndex(), AState::SCHEDULED ).ignore( );
422 states.set( node.
getAlgoIndex(), AState::EVTACCEPTED ).ignore( );