This plugin works with the developpement version of OpenMOLE.
- Install the developpement version of OpenMOLE
- Download the compiled gama plugin
- Extract them
- Upload them in the plugin pannel of the OpenMOLE interface or launch openmole -p /path/to/gamaPluginDirectory/.
The minimum usage should look like that:
val gama =
GamaTask(
workspace = workDirectory / "predator-prey",
model = "PedatorPrey.gaml",
experiment = "preyPred",
maxStep = 100)
Alternatively, you can define a stopping condition:
val gama =
GamaTask(
workspace = workDirectory / "predator-prey",
model = "PedatorPrey.gaml",
experiment = "preyPred",
maxStep = 100,
stopCondition = "empty(prey) and empty(predator)")
Then you can plug OpenMOLE input, output and set the seed of Gama to Gama ones in the set section:
val number_of_preys = Val[Int]
val nb_preys_init = Val[Int]
val seed = Val[Int]
val gama =
GamaTask(
workspace = workDirectory / "predator-prey",
model = "PedatorPrey.gaml",
experiment = "preyPred",
maxStep = 100) set (
gamaInputs += nb_preys_init,
gamaOutputs += number_of_preys,
gamaSeed := seed
)
A full experiment would look like that:
// Declare the variable
val number_of_preys = Var[Int]
val nb_preys_init = Var[Int]
// Gama task
// The third argument of the GamaTask is the gama experiment name
// and the fourth argument is the number of steps
val gama =
GamaTask(
workspace = workDirectory / "predator-prey",
model = "PedatorPrey.gaml",
experiment = "preyPred",
maxStep = 100) set (
gamaInputs += nb_preys_init,
gamaOutputs += number_of_preys,
gamaSeed := seed,
outputs += nb_preys_init
)
DirectSampling(
evaluation = Replication(gama, seed, 100),
sampling = (nb_preys_init in (0 to 200 by 10))
)