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

Method GetRunCounter

Core/KernelSML/src/sml_OldRunScheduler.cpp:168–187  ·  view source on GitHub ↗

* @brief Agents maintain a number of counters (for how many phase, * decisions etc.) they have ever executed. * We use these counters to determine when a run should stop. *********************************************************************/

Source from the content-addressed store, hash-verified

166* We use these counters to determine when a run should stop.
167*********************************************************************/
168unsigned long RunScheduler::GetRunCounter(gSKI::IAgent* pAgent, egSKIRunType runStepSize)
169{
170 switch (runStepSize)
171 {
172 case gSKI_RUN_SMALLEST_STEP:
173 return pAgent->GetNumSmallestStepsExecuted();
174 case gSKI_RUN_PHASE:
175 return pAgent->GetNumPhasesExecuted();
176 case gSKI_RUN_ELABORATION_CYCLE:
177 return pAgent->GetNumElaborationsExecuted();
178 case gSKI_RUN_DECISION_CYCLE:
179 return pAgent->GetNumDecisionCyclesExecuted();
180 case gSKI_RUN_UNTIL_OUTPUT:
181 return pAgent->GetNumOutputsExecuted();
182 case gSKI_RUN_FOREVER:
183 return pAgent->GetNumDecisionCyclesExecuted();
184 default:
185 return 0;
186 }
187}
188
189/*************************************************************************
190* @brief Returns true if phase1 is later in the execution cycle than phase2

Callers

nothing calls this directly

Tested by

no test coverage detected