PanmicticGA

interface PanmicticGA<V, F> : GA<V, F>

PanmicticGA - best known as the classical genetic algorithm (pGA).

V - value of Chromosome

F - fitness value of Chromosome

PanmicticGA is a heuristic search algorithm used to solve optimization and modeling problems by randomly selecting, combining, and varying the desired parameters using mechanisms similar to natural selection in nature. It includes a PanmicticPopulation (array) of homogeneous chromosomes. The evolution strategy is extended to a given population, changing its contents during the operation of the GA.

Creates with Kotlin DSL by pGA.

See also

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard

Duration between all subsessions of Session.

Link copied to clipboard

Creates SessionsInfo that describes all activity of GA.

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

The best Chromosome in Population by fitness.

Link copied to clipboard
val <V, F> GA<V, F>.bestFitness: F?

The best fitness of Chromosome in Population.

Link copied to clipboard
abstract var elitism: Int

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

Link copied to clipboard

Population Factory of GA.

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 isActive: Boolean

Return true if GA is active.

Link copied to clipboard
abstract val iteration: Int

Current iteration of genetic algorithm.

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

Mean fitness value of chromosomes in Population

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

Median fitness value of chromosomes in Population

Link copied to clipboard
val GA<*, *>.name: String

Population Name of GA.

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

Population of homogeneous chromosomes for PanmicticGA.

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 GA<*, *>.size: Int

Population Size of GA.

Link copied to clipboard
abstract val state: State

State describes the current state of the genetic algorithm.

Link copied to clipboard

Statistics configuration associated with GA.

Link copied to clipboard
abstract val timeStore: TimeStore

Store for all TimeMarkers of GA.

Link copied to clipboard
val <V, F> GA<V, F>.timeTotal: Duration

Duration between the first STARTED and last value of timeStore

Link copied to clipboard
val <V, F> GA<V, F>.worst: Chromosome<V, F>?

The worst Chromosome in Population by fitness.

Link copied to clipboard
val <V, F> GA<V, F>.worstFitness: F?

The worst fitness of Chromosome in Population.

Functions

Link copied to clipboard
inline suspend fun GA<*, *>.clearCollectors()

Unsubscribe and clear all collectors for StatisticsProvider.

Link copied to clipboard
fun <V, F> GA<V, F>.collect(id: String = BASE_COLLECTOR_ID, collector: STAT_COLLECTOR): GA<V, F>

Allows you to collect statistical data using reactive programming by kotlinx.coroutines.flow.

Link copied to clipboard
inline suspend fun GA<*, *>.removeCollector(id: String)

Unsubscribe and remove collector by id.

Link copied to clipboard
abstract suspend fun restart(forceStop: Boolean = false, resetPopulation: Boolean = true)

Immediately restart genetic algorithm.

Link copied to clipboard
suspend fun <V, F> PanmicticGA<V, F>.restart(populationSize: Int, populationBuffer: Int, forceStop: Boolean = false, resetPopulation: Boolean = true)

Immediately restart genetic algorithm.

Link copied to clipboard
abstract suspend fun resume()

Resume stopped genetic algorithm.

Link copied to clipboard
abstract suspend fun start()

Start genetic algorithm.

Link copied to clipboard
fun GA<*, *>.startBlocking(context: CoroutineContext = EmptyCoroutineContext)

Start GA with runBlocking, non suspend function.

Link copied to clipboard
abstract suspend fun stop(stopPolicy: StopPolicy = StopPolicy.Default)

Stop genetic algorithm.