MCPcopy Create free account
hub / github.com/SoarGroup/Soar / Interrupt

Method Interrupt

Core/KernelSML/src/sml_AgentSML.cpp:400–423  ·  view source on GitHub ↗

============================= Request that the agent stop soon. =============================

Source from the content-addressed store, hash-verified

398// Request that the agent stop soon.
399//=============================
400void AgentSML::Interrupt(smlStopLocationFlags stopLoc)
401{
402 // Tell the agent where to stop
403 m_interruptFlags = stopLoc;
404
405 // If the request for interrupt is sml_STOP_AFTER_DECISION_CYCLE, then it
406 // will be caught in the RunScheduler::CompletedRunType() and/or IsAgentFinished().
407 // We don't want to interrupt agents until the appropriate time if the request is
408 // sml_STOP_AFTER_DECISION_CYCLE.
409
410 // These are immediate requests for interrupt, such as from RHS or application
411 if ((sml_STOP_AFTER_SMALLEST_STEP == stopLoc) || (sml_STOP_AFTER_PHASE == stopLoc))
412 {
413 m_agent->stop_soar = true;
414 // If the agent is not running, we should set the runState flag now so agent won't run
415 if (m_runState == sml_RUNSTATE_STOPPED)
416 {
417 m_runState = sml_RUNSTATE_INTERRUPTED;
418 }
419 // Running agents must test stopLoc & stop_soar in Step method to see if interrupted.
420 // Because we set m_agent->stop_soar == true above, any running agents should return to
421 // gSKI at the end of the current phase, even if interleaving by larger steps. KJC
422 }
423}
424
425//=============================
426// Clear any existing interrupt requests

Callers 2

DoStopSoarMethod · 0.80
InterruptAllAgentsMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected