selection Roulette
fun <V> selectionRoulette(source: Array<Chromosome<V, Double>>, totalFitness: Double, random: Random): Chromosome<V, Double>
fun <V> selectionRoulette(source: Array<Chromosome<V, Float>>, totalFitness: Float, random: Random): Chromosome<V, Float>
fun <V> selectionRoulette(source: Array<Chromosome<V, Int>>, totalFitness: Long, random: Random): Chromosome<V, Int>
fun <V> selectionRoulette(source: Array<Chromosome<V, Long>>, totalFitness: Long, random: Random): Chromosome<V, Long>
fun <V> selectionRoulette(source: Array<Chromosome<V, Short>>, totalFitness: Long, random: Random): Chromosome<V, Short>
fun <V> selectionRoulette(source: Array<Chromosome<V, Byte>>, totalFitness: Long, random: Random): Chromosome<V, Byte>
Executes roulette selection. It is assumed that all individuals are "placed" on the roulette wheel.
For example, if you have 4 individuals with fitness 1, 2, 3, and 4, each of them will have its own "share" of the total 10 (1/10, 2/10, 3/10, and 4/10). A random number is generated between 0 and the total fitness (e.g. 10). The roulette wheel is spun and the random number "falls" on a sector, which corresponds to one of the individuals that will be selected.
Parameters
source
the population of Chromosomes
total Fitness
the sum of all fitness values in a population