Skip to content

Managing simulations

Sam Macbeth edited this page Apr 17, 2012 · 2 revisions

This guide follows on from Storing simulation data and will show you how to manage batches of simulations via Presage2′s command line interface (CLI) and web interface from a project set up as per the eclipse guide. You will need a project set up which has a storage driver defined (if you followed the steps in the previous guide this is already done).

Command line interface

The command line interface (CLI) provides an environment for performing some basic tasks such as adding simulations, listing stored simulations, and running simulations from a terminal.

To start the CLI shell you can right click on run/Presage2CLI.launch in your project and select ‘Run As’ -> ‘Presage2CLI’ as shown below:

Starting Presage2CLI from Eclipse

On the first run there may be several dependencies to download. Once this is done you will be presented with a prompt. The help command can be used to see which commands are available, and a -h argument can be used for specific help for each command:

Using Presage2 CLI

Web interface

The Presage2 web interface provides a GUI for managing simulations and viewing results in a web browser. Start if from the launch configuration run/WebUI.launch in the same way as with the CLI:

Launch Presage2 WebUI from Eclipse

Once the web server has started up, open a web browser and navigate to http://localhost:8080. You should see the webapp as below:

Presage2 WebUI interface

Running simulation example

We will now demonstrate how to create and run a simulation using the web interface. First we use the ‘New Simulation’ form to create the simulation and it’s parameters. We will run the myagents.MySimulation class with 2 agents and a simulation area of size 10. We set the initial state to “AUTO START”. This will automatically start the simulation in the background when possible. Fill out the form as shown below then click ‘Save’:

WebUI create simulation

Shortly after creating the simulation it should be executed, clicking the refresh button will show its progress. Once complete the state will be set to ‘COMPLETE’. You may add as many simulations as you wish to be run and they will be run consecutively (you can also configure the system to run more than one simulation in parallel as well as sending jobs to remote machines).

The plugins in the left menu provide more views of the data stored about simulations. For example if you use the LocationStoragePlugin to store agents’ locations during simulation, the environment visualiser will be able to animate this data for any simulation you choose.

Summary

We have shown how to use both the CLI and WebUI to manage and run simulations from within an eclipse project.

This concludes the getting started series of guides, you should now have enough to start building and running simulations!

Clone this wiki locally