Selection
Selection methods choose suitable individuals from the population based on fitness to guide reproduction.
GeneticAlgorithms.RouletteWheelSelection
— TypeRouletteWheelSelection()
Struct for Roulette Wheel Selection. This selection method is based on the cumulative probabilities of the fitness scores. Implemented as a callable object.
GeneticAlgorithms.RouletteWheelSelection
— Method(c::RouletteWheelSelection)(
population::Population{T},
fitness_scores::Vector{Float64},
rand_generator::F=rand,
)::Tuple{T,T} where {T<:Chromosome,F<:Function}
Performs Roulette Wheel Selection on a population based on fitness scores, returning two selected individuals (parents).
Selection is based on the cumulative probabilities of the fitness scores.
Arguments
population::Population
: The population of chromosomes from which to select.fitness_scores::Vector{Float64}
: A vector of fitness scores corresponding to the population.rand_generator<:Function=rand
: A function to generate random numbers, default isrand
.
Return
Tuple{T,T}
: A tuple containing two selected chromosomes (parents).