* @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
| 2389 | * @param newRate >= 1 |
| 2390 | *************************************************************/ |
| 2391 | bool 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 |