Skip to content
This repository has been archived by the owner on Jul 16, 2019. It is now read-only.

openmole/gama-plugin-old

 
 

Repository files navigation

Drawing

Drawing

Using this plugin in OpenMOLE

Installation

This plugin works with the developpement version of OpenMOLE.

Usage

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))
)

Releases

No releases published

Packages

No packages published

Languages

  • Scala 95.8%
  • Shell 4.2%