evolveCells

inline suspend fun <V, F> CellularEvolveScope<V, F>.evolveCells(crossinline evolution: CellEvolveScope<V, F>.() -> Unit)

Unique genetic operator for CellularGA performs an evolutionary strategy evolution for cells in CellularPopulation. The execution process is carried out depending on the CellularType.

Example:

evolve {
evolveCells {
selTournament(size = 3)
cxOnePoint(chance = 0.9)
mutFlipBit(chance = 0.2, flipBitChance = 0.02)
evaluation()
}

println("Iteration $iteration: best fitness = $bestFitness")
stopBy(maxIteration = MAX_ITERATION) { bestFitness == CHROMOSOME_SIZE }
}

Fully supports elitism - a child occupies a parent's cell if its fitness function value is greater.

Parameters

evolution

evolutionary strategy for individual cell using CellEvolveScope

See also