evolve

fun <V, F> DistributedConfigScope<V, F>.evolve(useDefault: Boolean = true, evolution: suspend DistributedEvolveScope<V, F>.() -> Unit)

Applies evolutionary strategy for DistributedGA (The most famous type of DistributedGA is the Island Generic Algorithm) as evolution function in DistributedEvolveScope that includes the process of launching child GAs (DistributedGA.children) and processes of interaction between subpopulations.

  • evolutionary strategy of DistributedGA is applied to child GAs

  • island evolutionary strategy looks like: independent launch child GAswaiting all GAs to be finishedmigration between subpopulations

When DistributedGA starts to evolve, its creates an infinite loop for your evolutionary strategy function. There are 3 main actions that occur in this loop:

  • Increment GA.iteration by one

  • Execute evolution

  • Check stops (If any stop rule is active - breaks infinite loop)

Example of creating base island evolutionary strategy with evolve function:

// init DistributedGA
dGA(
// configure common factory, fitnessFunction, population name and children (if already exist)
) {
// set ga's configuration here (adding children)

// set evolutionary strategy with evolve
evolve { (this = DistributedEvolveScope)
// don't forget to set a limit on the number of iterations
// otherwise the evolution will happen endlessly
stopBy(maxIteration = 5)
migration(percent = 0.1)
}
}

Parameters

useDefault

if true (default) used DistributedConfigScope.baseEvolve:

See also