CellEvolveScope

interface CellEvolveScope<V, F>

CellEvolveScope - evolveScope for cellular evolutionary strategy based on the evolution of a cell dependent on its neighbors.

V - value of Chromosome

F - fitness value of Chromosome

// Structure of a cellular population example:
Dimens.square(length = 5)
VonNeumann(radius = 1)

X X X X X
X X N X X
X N C N X
X X N X X
X X X X X

Where C - cell chromosome, N - neighbors for current cell chromosomes, X - other chromosomes in population.

The cellular evolutionary strategy is that all genetic operators are applied only on the target cell using only its neighbors: X chromosomes have no direct influence on the C chromosome during cellular evolution. Gene transfer between chromosomes that are not neighbors of each other occurs through common neighbors or common neighbors of neighbors, etc.

Not a standalone implementation of EvolveScope, it exists exclusively in the context of CellularEvolveScope.

Creates with CellEvolveScope().

See also

Properties

Link copied to clipboard
abstract var cell: Chromosome<V, F>

The target cell-chromosome for which evolution will occur.

Link copied to clipboard
abstract var fitnessFunction: (V) -> F

Fitness function - a function that evaluates the quality or "fitness" of each individual (chromosome) in a population. The fitness function determines how well a particular solution matches the target problem. It can be changed.

Link copied to clipboard
abstract val neighbors: Array<Chromosome<V, F>>

The neighbors chromosomes of the target cell chromosome used by genetic operators as participants in evolution for cell.

Link copied to clipboard
abstract val random: Random

Random for single cellular evolution. Defines a pseudorandom number generator for predictive calculations.

Functions

Link copied to clipboard
inline fun <V, F> CellEvolveScope<V, F>.crossover(chance: Double, crossover: (chromosome1: Chromosome<V, F>, chromosome2: Chromosome<V, F>) -> Unit)

Performs a crossover step for population in CellularGA that modify in-place the input chromosomes.

Link copied to clipboard
@JvmName(name = "crossoverUniformArray")
fun <T, F> CellEvolveScope<Array<T>, F>.crossoverUniform(chance: Double, chanceUniform: Double)
@JvmName(name = "crossoverUniformBooleanArray")
fun <F> CellEvolveScope<BooleanArray, F>.crossoverUniform(chance: Double, chanceUniform: Double)
@JvmName(name = "crossoverUniformByteArray")
fun <F> CellEvolveScope<ByteArray, F>.crossoverUniform(chance: Double, chanceUniform: Double)
@JvmName(name = "crossoverUniformCharArray")
fun <F> CellEvolveScope<CharArray, F>.crossoverUniform(chance: Double, chanceUniform: Double)
@JvmName(name = "crossoverUniformDoubleArray")
fun <F> CellEvolveScope<DoubleArray, F>.crossoverUniform(chance: Double, chanceUniform: Double)
@JvmName(name = "crossoverUniformFloatArray")
fun <F> CellEvolveScope<FloatArray, F>.crossoverUniform(chance: Double, chanceUniform: Double)
@JvmName(name = "crossoverUniformIntArray")
fun <F> CellEvolveScope<IntArray, F>.crossoverUniform(chance: Double, chanceUniform: Double)
@JvmName(name = "crossoverUniformLongArray")
fun <F> CellEvolveScope<LongArray, F>.crossoverUniform(chance: Double, chanceUniform: Double)
@JvmName(name = "crossoverUniformShortArray")
fun <F> CellEvolveScope<ShortArray, F>.crossoverUniform(chance: Double, chanceUniform: Double)
@JvmName(name = "crossoverUniformMutableList")
fun <T, F> CellEvolveScope<MutableList<T>, F>.crossoverUniform(chance: Double, chanceUniform: Double)

Executes a uniform crossover that modify in-place the input chromosomes. The attributes are swapped according to the chanceUniform probability.

Link copied to clipboard
@JvmName(name = "cxBlendDoubleArray")
fun <F> CellEvolveScope<DoubleArray, F>.cxBlend(chance: Double, alpha: Double)
@JvmName(name = "cxBlendFloatArray")
fun <F> CellEvolveScope<FloatArray, F>.cxBlend(chance: Double, alpha: Float)

Executes a blend crossover that modify in-place the input chromosomes. The blend crossover expects Chromosome.value of floating point numbers.

Link copied to clipboard
@JvmName(name = "cxKPointArray")
fun <T, F> CellEvolveScope<Array<T>, F>.cxKPoint(count: Int, chance: Double)
@JvmName(name = "cxKPointBooleanArray")
fun <F> CellEvolveScope<BooleanArray, F>.cxKPoint(count: Int, chance: Double)
@JvmName(name = "cxKPointByteArray")
fun <F> CellEvolveScope<ByteArray, F>.cxKPoint(count: Int, chance: Double)
@JvmName(name = "cxKPointCharArray")
fun <F> CellEvolveScope<CharArray, F>.cxKPoint(count: Int, chance: Double)
@JvmName(name = "cxKPointDoubleArray")
fun <F> CellEvolveScope<DoubleArray, F>.cxKPoint(count: Int, chance: Double)
@JvmName(name = "cxKPointFloatArray")
fun <F> CellEvolveScope<FloatArray, F>.cxKPoint(count: Int, chance: Double)
@JvmName(name = "cxKPointIntArray")
fun <F> CellEvolveScope<IntArray, F>.cxKPoint(count: Int, chance: Double)
@JvmName(name = "cxKPointLongArray")
fun <F> CellEvolveScope<LongArray, F>.cxKPoint(count: Int, chance: Double)
@JvmName(name = "cxKPointShortArray")
fun <F> CellEvolveScope<ShortArray, F>.cxKPoint(count: Int, chance: Double)
@JvmName(name = "cxKPointMutableList")
fun <T, F> CellEvolveScope<MutableList<T>, F>.cxKPoint(count: Int, chance: Double)

Executes a K point crossover on the input sequence individuals. The two values are modified in place.

Link copied to clipboard
@JvmName(name = "cxOnePointArray")
fun <T, F> CellEvolveScope<Array<T>, F>.cxOnePoint(chance: Double)
@JvmName(name = "cxOnePointBooleanArray")
fun <F> CellEvolveScope<BooleanArray, F>.cxOnePoint(chance: Double)
@JvmName(name = "cxOnePointByteArray")
fun <F> CellEvolveScope<ByteArray, F>.cxOnePoint(chance: Double)
@JvmName(name = "cxOnePointCharArray")
fun <F> CellEvolveScope<CharArray, F>.cxOnePoint(chance: Double)
@JvmName(name = "cxOnePointDoubleArray")
fun <F> CellEvolveScope<DoubleArray, F>.cxOnePoint(chance: Double)
@JvmName(name = "cxOnePointFloatArray")
fun <F> CellEvolveScope<FloatArray, F>.cxOnePoint(chance: Double)
@JvmName(name = "cxOnePointIntArray")
fun <F> CellEvolveScope<IntArray, F>.cxOnePoint(chance: Double)
@JvmName(name = "cxOnePointLongArray")
fun <F> CellEvolveScope<LongArray, F>.cxOnePoint(chance: Double)
@JvmName(name = "cxOnePointShortArray")
fun <F> CellEvolveScope<ShortArray, F>.cxOnePoint(chance: Double)
@JvmName(name = "cxOnePointMutableList")
fun <T, F> CellEvolveScope<MutableList<T>, F>.cxOnePoint(chance: Double)

Executes a one point crossover on the input sequence individuals. The two values are modified in place.

Link copied to clipboard
@JvmName(name = "cxOrderedIntArray")
fun <F> CellEvolveScope<IntArray, F>.cxOrdered(chance: Double)

Executes an ordered crossover (OX) on the input chromosome values. The two value are modified in place. This crossover expects Chromosome.value as IntArray. Mixes indexes without conflicts, preserving parental relationships.

Link copied to clipboard
@JvmName(name = "cxSimulatedBinaryDoubleArray")
fun <F> CellEvolveScope<DoubleArray, F>.cxSimulatedBinary(chance: Double, eta: Double)

Executes a simulated binary crossover that modify in-place the input chromosomes. The simulated binary crossover expects Chromosome.value of floating point numbers.

Link copied to clipboard
@JvmName(name = "cxSimulatedBinaryBoundedDoubleArray")
fun <F> CellEvolveScope<DoubleArray, F>.cxSimulatedBinaryBounded(chance: Double, eta: Double, low: Double, up: Double)

Executes a simulated binary crossover that modify in-place the input chromosomes. The simulated binary crossover expects Chromosome.value of floating point numbers.

Link copied to clipboard
fun <V, F> CellEvolveScope<V, F>.evaluation(compareWithSecondChild: Boolean = true, fitnessFunction: (V) -> F = this.fitnessFunction)

Evaluation stage for CellEvolveScope.cell.

Link copied to clipboard
inline fun <V, F> CellEvolveScope<V, F>.mutation(chance: Double, mutation: (chromosome: Chromosome<V, F>) -> Unit)

Performs a mutation step for population in CellularGA that modify in-place the input chromosomes. Mutates CellEvolveScope.cell.

Link copied to clipboard
@JvmName(name = "mutFlipBitBooleanArray")
fun <F> CellEvolveScope<BooleanArray, F>.mutFlipBit(chance: Double, flipBitChance: Double)
@JvmName(name = "mutFlipBitIntArray")
fun <F> CellEvolveScope<IntArray, F>.mutFlipBit(chance: Double, flipBitChance: Double)

Flip the value of the attributes of the input chromosome. The chromosome is expected to be a BooleanArray. This mutation is usually applied on boolean individuals.

Link copied to clipboard
fun <F> CellEvolveScope<DoubleArray, F>.mutGaussian(mean: Double, stddev: Double, chance: Double, gaussianChance: Double)

Applies a gaussian mutation of mean mean and standard deviation stddev on the input chromosome. This mutation expects Chromosome.value of floating point numbers.

Link copied to clipboard
fun <F> CellEvolveScope<DoubleArray, F>.mutPolynomialBounded(eta: Double, low: Double, up: Double, chance: Double, polynomialBoundedChance: Double)

Polynomial mutation as implemented in original NSGA-II algorithm in C by Deb. This mutation expects Chromosome.value of floating point numbers.

Link copied to clipboard
@JvmName(name = "mutShuffleIndexesArray")
fun <T, F> CellEvolveScope<Array<T>, F>.mutShuffleIndexes(chance: Double, shuffleIndexesChance: Double)
@JvmName(name = "mutShuffleIndexesBooleanArray")
fun <F> CellEvolveScope<BooleanArray, F>.mutShuffleIndexes(chance: Double, shuffleIndexesChance: Double)
@JvmName(name = "mutShuffleIndexesByteArray")
fun <F> CellEvolveScope<ByteArray, F>.mutShuffleIndexes(chance: Double, shuffleIndexesChance: Double)
@JvmName(name = "mutShuffleIndexesCharArray")
fun <F> CellEvolveScope<CharArray, F>.mutShuffleIndexes(chance: Double, shuffleIndexesChance: Double)
@JvmName(name = "mutShuffleIndexesDoubleArray")
fun <F> CellEvolveScope<DoubleArray, F>.mutShuffleIndexes(chance: Double, shuffleIndexesChance: Double)
@JvmName(name = "mutShuffleIndexesFloatArray")
fun <F> CellEvolveScope<FloatArray, F>.mutShuffleIndexes(chance: Double, shuffleIndexesChance: Double)
@JvmName(name = "mutShuffleIndexesIntArray")
fun <F> CellEvolveScope<IntArray, F>.mutShuffleIndexes(chance: Double, shuffleIndexesChance: Double)
@JvmName(name = "mutShuffleIndexesLongArray")
fun <F> CellEvolveScope<LongArray, F>.mutShuffleIndexes(chance: Double, shuffleIndexesChance: Double)
@JvmName(name = "mutShuffleIndexesShortArray")
fun <F> CellEvolveScope<ShortArray, F>.mutShuffleIndexes(chance: Double, shuffleIndexesChance: Double)
@JvmName(name = "mutShuffleIndexesMutableList")
fun <T, F> CellEvolveScope<MutableList<T>, F>.mutShuffleIndexes(chance: Double, shuffleIndexesChance: Double)

Executes a shuffle the attributes of the input chromosome. Usually this mutation is applied on vector of indices.

Link copied to clipboard
@JvmName(name = "mutUniformDoubleArray")
fun <F> CellEvolveScope<DoubleArray, F>.mutUniform(low: Double, up: Double, chance: Double, uniformChance: Double)
@JvmName(name = "mutUniformIntArray")
fun <F> CellEvolveScope<IntArray, F>.mutUniform(low: Int, up: Int, chance: Double, uniformChance: Double)
@JvmName(name = "mutUniformLongArray")
fun <F> CellEvolveScope<LongArray, F>.mutUniform(low: Long, up: Long, chance: Double, uniformChance: Double)

Executes a uniform mutation for the attributes of the input chromosome.

Link copied to clipboard
fun <V, F> CellEvolveScope<V, F>.selBest(count: Int, fillWithSelected: Boolean = false)

Executes best selection step for CellEvolveScope.neighbors.

Link copied to clipboard
inline fun <V, F> CellEvolveScope<V, F>.selection(selection: (source: Array<Chromosome<V, F>>) -> Chromosome<V, F>)

Performs a selection step for population in CellularGA. Selects one partner from neighbors determined by the CellularNeighborhood with selection function. Selected partner will be moved to the first position of CellEvolveScope.neighbors (index = 0).

Link copied to clipboard

Executes random selection step for CellEvolveScope.neighbors.

Link copied to clipboard
@JvmName(name = "selRouletteFitByte")
fun <V> CellEvolveScope<V, Byte>.selRoulette()
@JvmName(name = "selRouletteFitDouble")
fun <V> CellEvolveScope<V, Double>.selRoulette()
@JvmName(name = "selRouletteFitFloat")
fun <V> CellEvolveScope<V, Float>.selRoulette()
@JvmName(name = "selRouletteFitInt")
fun <V> CellEvolveScope<V, Int>.selRoulette()
@JvmName(name = "selRouletteFitLong")
fun <V> CellEvolveScope<V, Long>.selRoulette()
@JvmName(name = "selRouletteFitShort")
fun <V> CellEvolveScope<V, Short>.selRoulette()

Executes roulette selection step for CellEvolveScope.neighbors:

Link copied to clipboard

Executes tournament selection step for CellEvolveScope.neighbors:

Link copied to clipboard
fun <V, F> CellEvolveScope<V, F>.selWorst(count: Int, fillWithSelected: Boolean = false)

Executes best selection step for CellEvolveScope.neighbors.