Documentation > Tutorials
The composition of a full exploration experiment is achieved by writing a script in the OpenMOLE language, which is an extension of the Scala language. Such a script is called a workflow and should contain:
Once you've downloaded the model on your computer, you need to import it in OpenMOLE. There are two ways to do that, either by using the "upload a file" button on the left series of icons to import the nlogo file as is, or by using the "New project" button and selecting "Import your model" to open the model wizard. The model wizard will automatically detect the language in which the file is written, and the input and output parameters of your model, see below:
The oms script generated for the ants model is shown here:
Contents
Overview π
OpenMOLE is a model exploration tool. It offers several methods to perform experiments on a model, in order to better understand its behavior and capabilities.The composition of a full exploration experiment is achieved by writing a script in the OpenMOLE language, which is an extension of the Scala language. Such a script is called a workflow and should contain:
- some tasks (the model to explore needs to be embedded in a task for instance),
- their inputs and outputs as objects,
- an exploration method,
- some hooks to save or display the results of the exploration,
- and optionally, an execution environment.
Installing OpenMOLE on your computer π
The complete procedure to download and run OpenMOLE on your computer is explained in the Download section. Once OpenMOLE is up and running in your browser, you should see the GUI:Importing a toy model: Ants π
To illustrate this tutorial, we will be using the NetLogo Ants model. The model is available here.Once you've downloaded the model on your computer, you need to import it in OpenMOLE. There are two ways to do that, either by using the "upload a file" button on the left series of icons to import the nlogo file as is, or by using the "New project" button and selecting "Import your model" to open the model wizard. The model wizard will automatically detect the language in which the file is written, and the input and output parameters of your model, see below:
Executing the Ants model in OpenMOLE π
Workflow π
Based on the automatically detected parameters and NetLogo commands, the model wizard creates an OpenMOLE script containing variables for the input/output and a basic worflow to run your model. If you didn't use the model wizard to import the Ants model, you will need to write a workflow to execute it, similar to the one generated by the wizard and containing all the basics.The oms script generated for the ants model is shown here:
// Input values
val seed = Val[Int]
val diffusionRate = Val[Double]
val evaporationRate = Val[Double]
val population = Val[Double]
// Output values
val countFood = Val[Double]
val finalTicksFood1 = Val[Double]
val finalTicksFood2 = Val[Double]
val finalTicksFood3 = Val[Double]
// NetLogo command list
val launch = List("setup","go;;You should set your stopping criteria here instead")
// NetLogo task
val antsTask = NetLogo6Task(workDirectory / "ants.nlogo", launch, embedWorkspace = true,seed=seed) set(
inputs += diffusionRate mapped "diffusion-rate",
inputs += evaporationRate mapped "evaporation-rate",
inputs += population mapped "population",
outputs += countFood mapped "count-food",
outputs += finalTicksFood1 mapped "final-ticks-food1",
outputs += finalTicksFood2 mapped "final-ticks-food2",
outputs += finalTicksFood3 mapped "final-ticks-food3",
// Default values. Can be removed if OpenMOLEΒ Vals are set by values coming from the workflow
seed := 0,
diffusionRate := 21,
evaporationRate := 9,
population := 125)
// Workflow containing a hook to save execution outputs
antsTask hook DisplayHook()