Initialization
Population initialization methods generate the starting set of candidate solutions for the genetic algorithm, ensuring diversity and a suitable search space for optimization.
GeneticAlgorithms.RealUniformInitialization
— TypeRealUniformInitialization(population_size::Int64, chromosome_size::Int64, interval::Tuple{T,T})
RealUniformInitialization(population_size::Int64, chromosome_size::Int64, intervals::Vector{Tuple{T,T}})
Creates a population of population_size
including chromosomes of chromosome_size
. The chromosome-values are drawn from a uniform distribution over interval
. In the second constructor, the intervals
vector specifies the interval for each gene. The current implementation supports Float64
and Integer
types. The type is determined by the interval
. The struct must be called to create a population.
GeneticAlgorithms.RealUniformInitialization
— Method(c::RealUniformInitialization{T})()::Population{Chromosome{T}} where {T<:Float64}
Creates a population with Float genes.
GeneticAlgorithms.RealUniformInitialization
— Method(c::RealUniformInitialization{T})()::Population{Chromosome{T}} where {T<:Integer}
Creates a population with Integer genes.
GeneticAlgorithms.SudokuInitialization
— TypeSudokuInitialization(population_size::Int64, initial::Vector{Vector{Int64}})
Creates a population of population_size
including chromosomes of 9x9
size. Each gene resembles a column in a Sudoku puzzle. The initial values are taken from the initial
grid. initial
must be of size 9x9. The remaining values are filled with the missing random values. The initialization ensure that each column contains the values 1-9
exactly once.
GeneticAlgorithms.SudokuInitialization
— Method(c::SudokuInitialization)()::Population{Chromosome{Vector{Int64}}}
The population is created by calling the SudokuInitialization
object.