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

Method SetInterruptCheckRate

Core/ClientSML/src/sml_ClientKernel.cpp:2391–2408  ·  view source on GitHub ↗

* @brief The smlEVENT_INTERRUPT_CHECK event fires every n-th * step (phase) during a run. The n is controlled by * this rate. By setting a larger value there is less * overhead (checking to see if we wish to interrupt the run) * but response time to an interrupt will go down. * * Setting this rate does not register you for the event. * You should call Re

Source from the content-addressed store, hash-verified

2389* @param newRate >= 1
2390*************************************************************/
2391bool Kernel::SetInterruptCheckRate(int newRate)
2392{
2393 // Reject invalid rates
2394 if (newRate <= 0)
2395 {
2396 return false ;
2397 }
2398
2399 AnalyzeXML response ;
2400
2401 // Convert int to a string
2402 std::ostringstream ostr ;
2403 ostr << newRate ;
2404
2405 bool ok = GetConnection()->SendAgentCommand(&response, sml_Names::kCommand_SetInterruptCheckRate, NULL, sml_Names::kParamValue, ostr.str().c_str()) ;
2406
2407 return ok ;
2408}
2409
2410/*************************************************************
2411* @brief The Soar kernel version is based on sending a request

Callers 2

initializeMethod · 0.80

Calls 2

SendAgentCommandMethod · 0.80
GetConnectionFunction · 0.70

Tested by 1

initializeMethod · 0.64