Skip to content
Mazin Assanie edited this page Sep 18, 2016 · 29 revisions

soar

Controls settings related to running Soar

Usage

soar <sub-command or option> [value]

Sub-commands

init

soar init

The init-soar command re-initializes Soar. It removes all elements from working memory, wiping out the goal stack, and resets all runtime statistics. The firing counts for all productions are reset to zero. The init-soar command allows a Soar program that has been halted to be reset and start its execution from the beginning.

init-soar does not remove any productions from production memory; to do this, use the excise command. Note however, that all justifications will be removed because they will no longer be supported.

Soar Options

Invoke a sub-command with no arguments to query the current setting. Partial commands are accepted.

Option Valid Values Default
max-dc-time >= 0 0
max-elaborations > 0 100
max-goal-depth > 0 23
max-gp > 0 20000
max-memory-usage > 0 100000000
max-nil-output-cycles > 0 15
o-support-mode 3 or 4 4
stop-phase apply
wait-snc >= 1 1

max-dc-time

'max-dc-time' sets a maximum amount of time a deicsion cycle is permitted. After output phase, the elapsed decision cycle time is checked to see if it is greater than the old maximum, and the maximum dc time stat is updated (see stats). At this time, this threshold is also checked. If met or exceeded, Soar stops at the end of the current output phase with an interrupted state.

max-elaborations

'max-elaborations' sets and prints the maximum number of elaboration cycles allowed. If n is given, it must be a positive integer and is used to reset the number of allowed elaboration cycles. The default value is 100. max-elaborations with no arguments prints the current value.

'max-elaborations' controls the maximum number of elaborations allowed in a single decision cycle. The elaboration phase will end after max-elaboration cycles have completed, even if there are more productions eligible to fire or retract; and Soar will proceed to the next phase after a warning message is printed to notify the user. This limits the total number of cycles of parallel production firing but does not limit the total number of productions that can fire during elaboration.

This limit is included in Soar to prevent getting stuck in infinite loops (such as a production that repeatedly fires in one elaboration cycle and retracts in the next); if you see the warning message, it may be a signal that you have a bug your code. However some Soar programs are designed to require a large number of elaboration cycles, so rather than a bug, you may need to increase the value of max-elaborations.

'max-elaborations' is checked during both the Propose Phase and the Apply Phase. If Soar runs more than the max-elaborations limit in either of these phases, Soar proceeds to the next phase (either Decision or Output) even if quiescence has not been reached.

max-goal-depth

The 'max-goal-depth' command is used to limit the maximum depth of sub-states. The initial value of this variable is 100; allowable settings are any integer greater than 0. This limit is also included in Soar to prevent getting stuck in an infinite recursive loop, which may come about due to deliberate actions or via an agent bug, such as dropping inadvertently to state-no-change impasses.

max-gp

'max-gp' is used to limit the number of productions produced by a gp production. It is easy to write a gp production that has a combinatorial explosion and hangs for a long time while those productions are added to memory. The gp-max command bounds this.

max-memory-usage

The 'max-memory-usage' command is used to trigger the memory usage exceeded event. The initial value of this is 100MB (100,000,000); allowable settings are any integer greater than 0. The code supporting this event is not enabled by default because the test can be computationally expensive and is needed only for specific embedded applications. Users may enable the test and event generation by uncommenting code in mem.cpp.

max-nil-output-cycles

'max-nil-output-cycles' sets and prints the maximum number of nil output cycles (output cycles that put nothing on the output link) allowed when running using run-til-output (run --output). If n is not given, this command prints the current number of nil-output-cycles allowed. If n is given, it must be a positive integer and is used to reset the maximum number of allowed nil output cycles.

'max-nil-output-cycles' controls the maximum number of output cycles that generate no output allowed when a run --out command is issued. After this limit has been reached, Soar stops. The default initial setting of n is 15.

o-support-mode

The 'o-support-mode' command is used to control the way that o-support is determined for preferences. Only o-support modes 3 & 4 are valid (other modes require Soar 7, which is no longer supported). O-support mode 4 should be considered an improved version of mode 3. The default o-support mode is mode 4.

In o-support modes 3 & 4, support is given production by production; that is, all preferences generated by the RHS of a single instantiated production will have the same support. The difference between the two modes is in how they handle productions with both operator and non-operator augmentations on the RHS. For more information on o-support calculations, see the relevant appendix in the Soar manual.

stop-phase

'stop-phase' allows the user to control which phase Soar stops in.
When running by decision cycle it can be helpful to have agents stop at a particular point in its execution cycle. The precise definition is that "running for n decisions and stopping before phase ph means to run until the decision cycle counter has increased by n and then stop when the next phase is ph". The phase sequence (as of this writing) is: input, proposal, decision, apply, output. Stopping after one phase is exactly equivalent to stopping before the next phase.

wait-snc

'wait-snc' controls an architectural wait state. On some systems, especially those that model expert knowledge, a state-no-change may represent a wait state rather than an impasse. The waitsnc command allows the user to switch to a mode where a state-no-change that would normally generate an impasse (and subgoaling), instead generates a wait state. At a wait state, the decision cycle will repeat (and the decision cycle count is incremented) but no state-no-change impasse (and therefore no substate) will be generated.

Default Aliases

  • init-soar
  • init
  • is
  • All of the options also have their soar 9.5 command names as aliases

Examples

soar init
soar stop-phase output                 // stop before output phase
soar max-goal-depth 100
soar max-elaborations
Clone this wiki locally