Selection

The Selection process chooses individuals from the population to be the parents to create the next generation. The goal is to select individuals with the highest fitness. This promotes the survival of the best solution.

Selection Functions

GeneticAlgorithm.tournament_selectionFunction
tournament_selection(population::Vector, fitness::Vector, tournamentSize::Int, num::Integer)

Select one unit with higher fitness over several tournament rounds with randomly chosen groups of unit from the population .

Arguments

  • population: Population vector.
  • fitness: Vector of fitness values.
  • tournamentSize: Size of tournament groups.
  • num: Amount of genes to select

Returns

  • The unit with better fitness value.
source