Islands scheme is used via a specific task, IslandEvolution
to be added in the workflow.
SteadyStateEvolution
in the example
below ), to be distributed on the nodes of the distributed environmentparallelism
: the number of concurrent islands that evolve at a given timetermination
criterion is the total number of evolutions performed by all the islands.
In the example below, each island performs 100 iterations of their evolution tasks, so for 100 islands,
this parameter is set to 100*100= 10000.
val evolution =
SteadyStateEvolution(
// Definition of the optimisation algorithm
// mu is the size of the population
// genome is the inputs prototype and their variation ranges
// objectives are the objectives to minimise
algorithm =
NSGA2(
mu = 100,
genome = Seq(x in (0.0, 1.0), y in (0.0, 1.0)),
objectives = Seq(o1, o2)
),
evaluation = model,
termination = 100
)
// Generate a workflow that orchestrates 100 concurrent islands.
// The workflow stops when 10,000 islands have completed.
val island =
IslandEvolution(
evolution,
parallelism = 100,
termination = 10000
)
// Definition of a hook to save the population of solutions on the local machine running OpenMOLE
val savePopulation = SavePopulationHook(island, workDirectory / "evolution")
// Construction of the complete mole with the execution environment, and the hook.
// Here the generated workflow will run using 4 threads of the local machine.
(island on LocalEnvironment(4) hook savePopulation)