Selection

Selection methods choose suitable individuals from the population based on fitness to guide reproduction.

GeneticAlgorithms.RouletteWheelSelectionType
RouletteWheelSelection()

Struct for Roulette Wheel Selection. This selection method is based on the cumulative probabilities of the fitness scores. Implemented as a callable object.

source
GeneticAlgorithms.RouletteWheelSelectionMethod
(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 is rand.

Return

  • Tuple{T,T}: A tuple containing two selected chromosomes (parents).
source