**Apex Command Summary**

(the most frequently used features are in *italic*)

**Interactive Commands**

[Controlling the Simulation]{.underline}

*(load-simworld S)* : loads the simworld named S (a symbol)

*(startsim)* : start the simulation, or continue from pause

(restartsim) : restart simulation from beginning

(resetsim) : reset simulation to initial state

*(newsim)* : clear the simulation (needed before loading new simworld)

(stepsim) : advance the simulation one step

(set-pause-time T) : tell sim to pause at time T (integer or
TimeExpression)

(set-pause-cycle N) : tell sim to pause after every N cycles

(end-trial) : end the current trial (given while paused)

(current-time) : query current simulation time

[Controlling Event Trace]{.underline}

(show) : query the current TraceConstraint (syntax on next page)

(show :runtime) : see event trace as simulation runs (useful for
debugging)

(show :hms) : see time displayed in hours/mins/secs

*(show :level level)* : effects the given ShowLevel (see list of levels
below)

*(show EventType)* : adds event type to trace (see event types list)

(show Constraint) : adds events matching given TraceConstraint to trace

(unshow) : turns off event trace

(unshow :runtime) : don\'t see event trace as simulation runs

(unshow :hms) : see time displayed as an integer

*(unshow EventType)* : removes event type from trace (see event types
list)

(unshow Constraint) : removes events matching given TraceConstraint from
trace

*(generate-trace)* : generate and print the trace

(trace-size) : query number of events in latest trace

[Predefined show levels]{.underline}

all : all events

none : no events

actions : resource related events

asa-low, asa-medium, asa-high : action selection architecture related
events

cogevents : cognitive events

simulation : activity related events

[Trace-related syntax]{.underline}

Notation: \| indicates alternatives, \* means 0 or more of preceding
element, + means one or more of preceding element.

Explanations enclosed in { } brackets.

TraceConstraint :

TraceParameter { see below }

\| (and TraceConstraint\*) { matches events meeting all given
constraints }

\| (or TraceConstraint\*) { matches events meeting any given constraint
}

\| (not TraceConstraint) { matches events that fail the given constraint
}

TraceParameter :

(event-type \<symbol\>) { matches events of given type }

\| (object-id \<symbol\>) { matches events containing given object }

\| (time-range (\<low\> \<high\>)) { matches events occuring in given
time range }

TimeExpression : (TimePair+) { one or more int/unit pairs }

TimePair : (\<integer\> TimeUnit)

TimeUnit : ms \| msec \| msecs

\| s \| sec \| secs \| second \| seconds

\| m \| min \| mins \| minute \| minutes

\| d \| day \| days

**Things that go in initialize.lisp**

(initialize-simulation ...) : (required) specify how to initialize
simulation

[Simulation Parameters for initialize-simulation]{.underline}

(set-number-of-trials N) : specify how many trials to run

(pause-after-trial flag) : specify whether to pause after each trial
(t/nil)

(pause-after-init flag) : specify whether to pause after initialization

(do-before-all-trials \...) : specify things to do before trials have
begun

(do-after-all-trials \...) : specify things to do after all trials have
ended

(do-after-each-trial \...) : specify things to after each trial

**Misc.**

(define-show-level name TraceConstraint) : defines show level (name is
symbol)