Documentation

Version 1.2.0 Beta 1

5. Running Simulations

Simulations are loaded and run via commands placed in NanoHive-1's command queue. The exact mechanism by which these commands are added to the queue depends on the NanoHive-1 installation, for example, an installation may load both the ConsoleCommand and RMI_Control Simulation Control plugins, providing two channels for adding commands to the queue. The documentation for each Simulation Control plugin will detail how to use it to control the simulator, but two common Simulation Control plugins, ConsoleCommand and SocketsControl, use a command line scheme. The following is their command line usage synopsis:

  load simulation -f simspec.xml -n simId
    load the simulation file simspec.xml and name it simId
  load workunit -f workunit.zip [-d] -n simId
    load the work unit file workunit.zip, optionally from the work unit 
    staging directory, and name it simId
  run simId
    run the simulation named simId
  status simId
    show the status of the simulation named simId
  status -s [simId]
    show the status of all loaded simulations, or optionally, just the one
    named simId
  status -p picId
    show the status of the Physical Interaction Calculator named picId
  stop simId
    stop the simulation named simId
  set -g [-p var[=val]] | -s simId [-p var[=val]]
    set/get global parameters, or simulation parameters
  exit
    command NanoHive-1 to shutdown and exit

The following is an example of how to load and run the simulation specified in a file c:\simulations\battle-bot.xml. First, the simulation must be loaded. Assuming that NanoHive-1 is running (with the ConsoleCommand plugin loaded), and that the simulation workflow and specification file are ready, load the simulation with the following command:

load simulation -f c:\simulations\battle-bot.xml -n bbot

bbot is how we will refer to the simulation once it's loaded.

To run the simulation use the command:

run bbot

To get the status of the running simulation use the command:

status bbot

This command will return two pieces of information: whether the simulation is running or idle, and if running, what percentage complete it is. Once a simulation completes, it will inform the user who initiated the run command asynchronously.

To stop a simulation while it's running use the command:

stop bbot

To exit NanoHive-1, use the command:

exit

5.1. Viewing and Modifying Parameters

There are two sets of parameters that apply to a simulation: global parameters initially set in the NanoHive-1 configuration file, and simulation-specific parameters initially set in the simulation specification file. View all global parameters with the command:

set

View a specific global parameter with the command:

set -g -p <parameter-name>

While the reported global parameter values can be changed once NanoHive-1 is running, changing them will not affect NanoHive-1. You may, however, wish to store some global parameters. Store and change global parameters with the command:

set -g -p <parameter-name>=<parameter-value>

Once a simulation is loaded, view all the simulation parameters with the command:

set -s <simulation-id>

View a specific simulation paramater with the command:

set -s <simulation-id> -p <parameter-name>

Change a simulation parameter with the command:

set -s <simulation-id> -p <parameter-name>=<parameter-value>


Last Modified: 5/17/2006