| 25 | using namespace sml; |
| 26 | |
| 27 | bool CommandLineInterface::DoRun(const RunBitset& options, int count, eRunInterleaveMode interleaveIn) |
| 28 | { |
| 29 | // Default run type is sml_DECISION |
| 30 | smlRunStepSize runType = sml_DECISION; |
| 31 | //// ... unless there is a count, then the default is a decision cycle: |
| 32 | //if (count >= 0) runType = sml_DECISION; |
| 33 | |
| 34 | bool forever = false; |
| 35 | |
| 36 | // Override run type with option flag: |
| 37 | if (options.test(RUN_ELABORATION)) |
| 38 | { |
| 39 | runType = sml_ELABORATION; |
| 40 | |
| 41 | } |
| 42 | else if (options.test(RUN_PHASE)) |
| 43 | { |
| 44 | runType = sml_PHASE; |
| 45 | |
| 46 | } |
| 47 | else if (options.test(RUN_DECISION)) |
| 48 | { |
| 49 | runType = sml_DECISION; |
| 50 | |
| 51 | } |
| 52 | else if (options.test(RUN_OUTPUT)) |
| 53 | { |
| 54 | runType = sml_UNTIL_OUTPUT; |
| 55 | } |
| 56 | else |
| 57 | { |
| 58 | // if there is no step size given and no count, we're going forever |
| 59 | forever = (count < 0); |
| 60 | } |
| 61 | |
| 62 | if (count == -1) |
| 63 | { |
| 64 | count = 1 ; |
| 65 | } |
| 66 | |
| 67 | smlRunResult runResult ; |
| 68 | |
| 69 | // NOTE: We use a scheduler implemented in kernelSML rather than |
| 70 | // the gSKI scheduler implemented by AgentManager. This gives us |
| 71 | // more flexibility to adjust the behavior of the SML scheduler without |
| 72 | // impacting SoarTech systems that may rely on the gSKI scheduler. |
| 73 | RunScheduler* pScheduler = m_pKernelSML->GetRunScheduler() ; |
| 74 | smlRunFlags runFlags = sml_NONE ; |
| 75 | |
| 76 | if (options.test(RUN_UPDATE)) |
| 77 | { |
| 78 | runFlags = sml_UPDATE_WORLD ; |
| 79 | } |
| 80 | else if (options.test(RUN_NO_UPDATE)) |
| 81 | { |
| 82 | runFlags = sml_DONT_UPDATE_WORLD ; |
| 83 | } |
| 84 |
no test coverage detected