CellularConfigScope

class CellularConfigScope<V, F>(val population: CellularPopulation<V, F>, var fitnessFunction: (V) -> F) : AbstractConfigScope<V, F, CellularEvolveScope<V, F>> , CellularConfig<V, F>

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

Constructors

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

Properties

Link copied to clipboard
abstract val afterEvolution: suspend CellularEvolveScope<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 CellularEvolveScope<V, F>.() -> Unit

Fills population if needed, cached neighborhood indices and evaluates all chromosomes.

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

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

Link copied to clipboard
open override var cellularType: CellularType

Cellular type for CellularGA.

Link copied to clipboard
open override var elitism: Boolean

Flag for elitism in CellularGA.

Link copied to clipboard
abstract val evolution: suspend CellularEvolveScope<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

Neighborhood for CellularGA.

Link copied to clipboard

Parallelism configuration associated with GA.

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

Override base population as CellularPopulation for CellularGA.

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> CellularConfigScope<V, F>.after(afterEvolution: suspend CellularEvolveScope<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> CellularConfigScope<V, F>.before(useDefault: Boolean = true, beforeEvolution: suspend CellularEvolveScope<V, F>.() -> Unit)

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

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

Applies evolutionary strategy for CellularGA (Cellular Genetic Algorithm) as evolution function in CellularEvolveScope 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 CellularConfig.

Link copied to clipboard

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