Driver Command Line Interface

When the Driver application is executed, after a brief setup period it returns control to the user with a ‘SME>‘ prompt. The user may input the following simulation commands (sim-cmds) at the SME prompt to control and configure various aspects of the simulation.

8.1 Simulation Control Sim-cmds

These sim-cmds are used to start, stop, step, break, and exit the simulation.

8.1.1 Step Sim-cmd: s

s {e,c}

DESCRIPTION:

This sim-cmd steps the simulation forward by one exe-cmd or one event. Each event is composed of a sorted list of exe-cmds that are executed at the same (simulation) time (see section 4.3). Each exe-cmd updates the data structures of one variable.

ARGUMENT1 (optional char):

e :Step one event (default).

c :Step one exe-cmd.

8.1.2 Run Sim-cmd: r

r {endTime}

DESCRIPTION:

This sim-cmd is used to run the simulation until endTime is reached in simulation time. The endTime parameter is measured in simulation time units (i.e. same units as the argument x to the dt(x) config-cmd).

ARGUMENT1 ( optional float ):

endTime :Run Simulation until endTime is reached.

8.1.3 Break Sim-cmd: b

b {c,a,i,u,p,C,D} {0,1}

DESCRIPTION:

This sim-cmd is used to set break points in the simulation execution. The simulation retruns control to the user ( ‘SME>‘ prompt ) jut prior to executing a exe-cmd with a break point attached.

ARGUMENT1 ( optional char ):

c :Set a break point on the current exe-cmd.

a :Set breaks on all exe-cmds associated with the current variable.

i :Set break on init exe-cmds associated with current variable.

u :Set break on update exe-cmds associated with current variable.

p :Set break on pipe exe-cmds associated with current variable.

C :Clear breaks associated with current variable.

D :Clear breaks associated with current exe-cmd.

ARGUMENT2 ( optional bool (0,1): default = 1 ):

1 :Set break point(s) on the selected exe-cmd(s).

0 :Remove break point(s) on the selected exe-cmd(s).

8.1.4 Stop Sim-cmd: S

S

DESCRIPTION:

This sim-cmd is used reset the simulation to it’s inital state. At this point, issuing a r sim-cmd will restart the simulation from the beginning.

8.1.5 Exit Sim-cmd: X

X

DESCRIPTION:

This sim-cmd is used exit the simulation.

8.2 Sim-cmds for Setting Context

The following sim-cmds are used to choose the current Module, Variable, Event, or exe-cmd. These sim-cmds set the context for other sim-cmds.

8.2.1 Set Module Sim-cmd: m

m {<moduleName>}

DESCRIPTION:

This sim-cmd sets the current module to the module listed in the first argument.

ARGUMENT1 ( optional string, default = NULL ):

<moduleName>} :Name of a module in the simulation.

8.2.2 Set Variable Sim-cmd: v

v {<moduleName>} {<variableName>}

DESCRIPTION:

This sim-cmd sets the current variable to the variable listed in the first two arguments.

ARGUMENT1 ( optional string, default = NULL ):

<moduleName> :Name of a module in the simulation.

ARGUMENT2 ( optional string, default = NULL ):

<variableName> :Name of a variable in module <moduleName>.

8.2.3 List Objects Sim-cmd: l

l {m,v,c,d}

DESCRIPTION:

This sim-cmd is used to generated a numbered list of module, variable, exe-cmd, or dependency objects. Items can be choosen from this list using the ‘Choose’ (c) sim-cmd. An item that is choosen becomes current.

ARGUMENT1 ( optional char, default = previous value ):

m :List the modules in the simulation.

v :List the variables in the current module.

c :List the exe-cmds associated with the current variable.

d :List the variable dependencies associated with the current exe-cmd.

8.2.4 Choose Object Sim-cmd: c

c [index]

DESCRIPTION:

This sim-cmd is used to choose a module, variable, command, or dependency object from the most recently generated list ( ‘List Objects’ sim-cmd ). An item that is choosen becomes current.

ARGUMENT1 ( required int ):

index: Index of item in list to be choosen.

8.3 Data Access Sim-cmds

The following sim-cmds are used to retrieve data from the the current Model, Module, Variable, Event, or exe-cmd object.

8.3.1 Query Sim-cmd: q

q {s,t,m,i,c}

DESCRIPTION:

This sim-cmd is used to query the current variable for information classified as space, time, mode, initmode, and class (according to the first argument). With no arguments the name of the current variable is returned.

ARGUMENT1 ( optional float ):

s :Return Spatial mode.

t :Return temporal mode.

m :Return special mode.

i :Return init mode.

c: :Return class.

8.3.2 Dump Sim-cmd: d

d {startIndex} {endIndex}

DESCRIPTION:

This sim-cmd is used to dump an array of floating-point data from the current variable. The array ordering follows the internal ordering of data for the variable. If a spatial grid is needed, use the dg sim-cmd.

ARGUMENT1 ( optional int, default=0 ):

Index of first data element.

ARGUMENT2 (optional int, default=100):

Index of final data element.

8.3.3 Dump Grid Sim-cmd: dg

dg { rowIndex, colIndex }

DESCRIPTION:

This sim-cmd is used to dump a 25x25 array of floating-point data from the current variable. The array is spatially ordered, the first argument gives that coordinate of the upper-left corner of the array on the Frame’s grid.

ARGUMENT1 ( optional coordinates, default=(0,0) ):

Frame coordinates of the upper-left corner of the array (row,col).

8.3.4 Dump Point Sim-cmd: dp

dp [ rowIndex, colIndex ]

DESCRIPTION:

This sim-cmd is used to dump a floating-point value from the current variable at a specified point. The first argument gives the coordinate of the point on the Frame’s grid.

ARGUMENT1 ( required coordinates ):

Frame coordinates of the point to be printed(row,col).

8.3.5 Display Code Sim-cmd: dc

dc

DESCRIPTION:

This sim-cmd is used to display the code executed by the current exe-cmd.

8.3.6 Display Data in Viewer: dv

dv

DESCRIPTION:

This sim-cmd is used to display the the variable’s data in a viewer. (Note this command is only available if the SME is built with Java enabled). If the variable is spatial then the variable’s spatial data at the current timestep will be sent to a map viewer, if the variable is non-spatial then the variable’s timeseries data will be sent to a graph viewer.

8.3.7 Variable Data Sim-cmd: V

V

DESCRIPTION:

This sim-cmd is used display data about the current variable.

8.4 Configuration Sim-cmds

The following sim-cmds are used configure various aspects of the simulation. They are used primarily by the SME java interface, but are listed here for completeness.

8.4.1 Configure Sim-cmd: C

C [a,m,v,<externalName>] [config-cmd]

DESCRIPTION:

This command is used to pass config-cmds to one of the current objects in the simulation. The first argument determines the class of object to receive the config-cmd, and the second argument is any config-cmd that can be accepted by that class of objects (see section 7 for details).

ARGUMENT1 ( required string or char ):

a :Pass the config-cmd to the model object.

m :Pass the config-cmd to the current module object.

v :Pass the config-cmd to the current Variable object.

<externalName> : Pass the config-cmd to the external object named.

ARGUMENT2 ( required string ):

config-cmd : config-cmd as listed in section 7.

8.4.2 Network Sim-cmd: N

N [<hostName>] {<timeOut>} {<buffSize>} {<dataSize>} {<sync>}

DESCRIPTION:

This sim-cmd is used to pass network information to the Driver that is used when the socket connection is established between the interface and the Driver. This sim-cmd is used primarily by the SME interfaces.

8.4.3 Delete Pipe Sim-cmd: k

k {pipeCmd}

DESCRIPTION:

This sim-cmd is used to delete a pipe command associated with the current variable. With no arguments all pipes associated with the current variable are deleted. The sim-cmd is used primarily by the SME interfaces.

ARGUMENT1 ( optional string ):

pipeCmd :Pipe command to be deleted (see SECTION 7).