DistributedEvolveScope

DistributedEvolveScope - specific EvolveScope for DistributedGA.

V - value of Chromosome

F - fitness value of Chromosome

Creates with DistributedEvolveScope().

See also

Properties

Link copied to clipboard
val <V, F> EvolveScope<V, F>.best: Chromosome<V, F>?

The best Chromosome in Population by fitness. Uses a StatisticsConfig.guaranteedSorted for optimization, except in the case of a call from DistributedEvolveScope.

Link copied to clipboard

The best fitness of Chromosome in Population. Uses a StatisticsConfig.guaranteedSorted for optimization, except in the case of a call from DistributedEvolveScope.

Link copied to clipboard
abstract val children: List<GA<V, F>>

Child GAs for owner DistributedGA.

Link copied to clipboard

Population Factory of GA.

Link copied to clipboard

Flag to stop evolution process cause stop condition has been worked.

Link copied to clipboard

Flag to stop evolution process cause the max iteration has been reached.

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 iteration: Int

Current iteration of genetic algorithm.

Link copied to clipboard
@get:JvmName(name = "getMeanDouble")
val EvolveScope<*, Double>.mean: Double
@get:JvmName(name = "getMeanInt")
val EvolveScope<*, Int>.mean: Double
@get:JvmName(name = "getMeanLong")
val EvolveScope<*, Long>.mean: Double

Mean fitness value of chromosomes in Population

Link copied to clipboard
@get:JvmName(name = "getMedianDouble")
val EvolveScope<*, Double>.median: Double
@get:JvmName(name = "getMedianInt")
val EvolveScope<*, Int>.median: Double
@get:JvmName(name = "getMedianLong")
val EvolveScope<*, Long>.median: Double

Median fitness value of chromosomes in Population

Link copied to clipboard

Population Name of GA.

Link copied to clipboard

Store parallelism configuration for GA. Determines genetic operators process.

Link copied to clipboard
abstract override val population: DistributedPopulation<V, F>

Override base population as DistributedPopulation for DistributedGA.

Link copied to clipboard
abstract val random: Random

Random associated with GA. Defines a pseudorandom number generator for predictive calculations.

Link copied to clipboard
val EvolveScope<*, *>.size: Int

Population Size of GA.

Link copied to clipboard

Option for starting children.

Link copied to clipboard

Statistics configuration associated with GA.

Link copied to clipboard
abstract val store: MutableMap<String, Any?>

Store serves to synchronize between iterations of GA.

Link copied to clipboard

Duration between current and previous iteration.

Link copied to clipboard
abstract val timeStore: TimeStore

Store for all TimeMarkers of GA.

Link copied to clipboard

The worst Chromosome in Population by fitness. Uses a StatisticsConfig.guaranteedSorted for optimization, except in the case of a call from DistributedEvolveScope.

Link copied to clipboard

The worst fitness of Chromosome in Population. Uses a StatisticsConfig.guaranteedSorted for optimization, except in the case of a call from DistributedEvolveScope.

Functions

Link copied to clipboard

Creates Statistic for best fitness of Chromosome in Population.

Link copied to clipboard
abstract suspend fun emitStat(value: StatisticNote<Any?>)
Link copied to clipboard
inline suspend fun <V, F> EvolveScope<V, F>.evaluateAll(start: Int, end: Int, parallelismLimit: Int, crossinline fitnessFunction: (V) -> F)

Base evaluates function for all chromosomes in Population by fitnessFunction

Link copied to clipboard
suspend fun <V, F> DistributedEvolveScope<V, F>.launchChildren(parallelismLimit: Int)
Link copied to clipboard

Executes random migration stage. Migration in DistributedGA is a process of chromosomes exchange between subpopulations.

Link copied to clipboard
inline suspend fun EvolveScope<*, *>.parallelProcess(parallelismLimit: Int, startIteration: Int, endIteration: Int, crossinline action: suspend (iteration: Int, random: Random) -> Unit)

Iterative parallel process action from startIteration to endIteration.

inline suspend fun EvolveScope<*, *>.parallelProcess(parallelismLimit: Int, startIteration: Int, endIteration: Int, step: Int, crossinline action: suspend (iteration: Int, random: Random) -> Unit)

Iterative parallel process action from startIteration to endIteration with step.

Link copied to clipboard
inline fun EvolveScope<*, *>.process(parallelismLimit: Int, sequential: () -> Unit, parallel: () -> Unit)

Process action with sequential or parallel mode.

inline suspend fun EvolveScope<*, *>.process(parallelismLimit: Int, startIteration: Int, endIteration: Int, crossinline action: suspend (iteration: Int, random: Random) -> Unit)

Iterative process action from startIteration to endIteration.

inline suspend fun EvolveScope<*, *>.process(parallelismLimit: Int, startIteration: Int, endIteration: Int, step: Int, crossinline action: suspend (iteration: Int, random: Random) -> Unit)

Iterative process action from startIteration to endIteration with step.

Link copied to clipboard
inline fun EvolveScope<*, *>.randomByChance(chance: Double, action: () -> Unit)

Execute action with probability chance (0.0 < 1.0)

Link copied to clipboard
inline fun <V, F> EvolveScope<V, F>.shake(percent: Double): Pair<Int, Int>

Shake percent*100% population with Population.reset function.

fun <V, F> EvolveScope<V, F>.shake(from: Int, to: Int)

Shake population with Population.reset function.

Link copied to clipboard

Creates Statistic for size of Population

Link copied to clipboard
suspend fun EvolveScope<*, *>.stat(statistic: Statistic<Any?>)
@JvmName(name = "statValue")
suspend fun EvolveScope<*, *>.stat(pair: Pair<String, Any?>)
@JvmName(name = "statRegister")
suspend fun EvolveScope<*, *>.stat(pair: Pair<String, () -> Any?>)
suspend fun EvolveScope<*, *>.stat(name: String, value: Any?)
suspend fun EvolveScope<*, *>.stat(vararg statistics: Statistic<Any?>)
@JvmName(name = "statValue")
suspend fun EvolveScope<*, *>.stat(vararg pairs: Pair<String, Any?>)
@JvmName(name = "statRegister")
suspend fun EvolveScope<*, *>.stat(vararg pairs: Pair<String, () -> Any?>)
inline suspend fun EvolveScope<*, *>.stat(name: String, registrar: () -> Any?)

Creates SingleStatisticNote and send it to GA.statisticsProvider Use registrar function

Link copied to clipboard
inline fun <V, F> EvolveScope<V, F>.stopBy(stopCondition: EvolveScope<V, F>.() -> Boolean)

Stop and finish GA if stopCondition return true.

inline fun <V, F> EvolveScope<V, F>.stopBy(maxIteration: Int = Int.MAX_VALUE)

Stop and finish GA if iteration more or equal to maxIteration.

inline fun <V, F> EvolveScope<V, F>.stopBy(maxIteration: Int = Int.MAX_VALUE, stopCondition: EvolveScope<V, F>.() -> Boolean)

Stop and finish GA if:

Link copied to clipboard
Link copied to clipboard

Creates Statistic for worst fitness of Chromosome in Population.