PanmicticConfigScope

class PanmicticConfigScope<V, F>(val population: PanmicticPopulation<V, F>, var fitnessFunction: (V) -> F) : AbstractConfigScope<V, F, PanmicticEvolveScope<V, F>> , PanmicticConfig<V, F>

Implementation of PanmicticConfig based on AbstractConfigScope. Params population and fitnessFunction are considered mandatory.

Constructors

Link copied to clipboard
constructor(population: PanmicticPopulation<V, F>, fitnessFunction: (V) -> F)

Properties

Link copied to clipboard
abstract val afterEvolution: suspend PanmicticEvolveScope<V, F>.() -> Unit

Callback after evolution process. Executed at launch when GA.state is going to be State.FINISHED.

Link copied to clipboard
val baseBefore: suspend PanmicticEvolveScope<V, F>.() -> Unit

Fills population if needed and evaluates all chromosomes (include elite ones).

Link copied to clipboard
open override var beforeEvolution: suspend PanmicticEvolveScope<V, F>.() -> Unit

Callback before evolution process. Executed only once at launch if GA.iteration is 0.

Link copied to clipboard
open override var elitism: Int

Number of elite chromosomes - the best chromosomes of the population, which have privileged rights:

Link copied to clipboard
abstract val evolution: suspend PanmicticEvolveScope<V, F>.() -> Unit

Main evolution process.

Link copied to clipboard
open override 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.

Link copied to clipboard

Parallelism configuration associated with GA.

Link copied to clipboard
open override val population: PanmicticPopulation<V, F>

Override base population as PanmicticPopulation for PanmicticGA.

Link copied to clipboard
abstract var random: Random

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

Link copied to clipboard

Statistics configuration associated with GA.

Link copied to clipboard
abstract val timeStore: TimeStore

Store for all TimeMarkers of GA.

Functions

Link copied to clipboard
fun <V, F> PanmicticConfigScope<V, F>.after(afterEvolution: suspend PanmicticEvolveScope<V, F>.() -> Unit)

Callback after evolution process which will be invoked when GA.state is going to be State.FINISHED.

Link copied to clipboard
fun <V, F> PanmicticConfigScope<V, F>.before(useDefault: Boolean = true, beforeEvolution: suspend PanmicticEvolveScope<V, F>.() -> Unit)

Callback before evolution process which will be invoked if GA.iteration is 0.

Link copied to clipboard
fun <V, F> PanmicticConfigScope<V, F>.evolve(evolution: suspend PanmicticEvolveScope<V, F>.() -> Unit)

Applies evolutionary strategy for PanmicticGA (Classical Genetic Algorithm) as evolution function in PanmicticEvolveScope that includes the process of changing the population for one iteration.

Link copied to clipboard

Creates ParallelismConfig with ParallelismConfigScope and apply it to the current Config.

Creates ParallelismConfig with ParallelismConfigScope and apply it to the current PanmicticConfig.

Link copied to clipboard

Creates StatisticsConfig with StatisticsConfigScope and apply it to the current Config.