Package-level declarations

Types

Link copied to clipboard

Describes the configuration parameters necessary for the operation of the PanmicticGA.

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

Link copied to clipboard
Link copied to clipboard
interface PanmicticGA<V, F> : GA<V, F>

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

Link copied to clipboard

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
fun <V, F> PanmicticEvolveScope(panmicticGA: PanmicticGA<V, F>, panmicticConfig: PanmicticConfig<V, F>): PanmicticEvolveScope<V, F>

Creates an instance of PanmicticEvolveScope by panmicticGA and panmicticConfig.

Link copied to clipboard

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

Link copied to clipboard
inline fun <V, F> pGA(population: PanmicticPopulation<V, F>, noinline fitnessFunction: (V) -> F, config: PanmicticConfigScope<V, F>.() -> Unit): PanmicticGA<V, F>

Creates PanmicticGA with Kotlin DSL.

Link copied to clipboard
fun <V, F> population(population: Array<Chromosome<V, F>>, buffer: Int = 0, name: String = DEFAULT_POPULATION_NAME, factory: PopulationFactory<V, F>): PanmicticPopulation<V, F>
fun <V, F> population(size: Int, buffer: Int = 0, name: String = DEFAULT_POPULATION_NAME, factory: PopulationFactory<V, F>): PanmicticPopulation<V, F>
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.