selectionWithIndex

inline suspend fun <V, F> PanmicticEvolveScope<V, F>.selectionWithIndex(parallelismLimit: Int, crossinline selection: (index: Int, source: Array<Chromosome<V, F>>, random: Random) -> Chromosome<V, F>)

Performs a selection step for population in PanmicticGA. Suitable for selection mechanisms where behavior depends on indices. For example: selTournament

Welcome to use for your own implementations! It is a base function for executing selection step in PanmicticGA. Fully supports elitism - elite chromosomes go through the selection stage by default.

Parameters

parallelismLimit

limit of parallel workers

selection

specific selection action with index (How chromosomes will be selected from current population)

See also