Mutation
Mutation methods introduce random changes to chromosomes, helping to maintain diversity and explore new possibilities in optimization algorithms.
GeneticAlgorithms.RealGeneMutation
— TypeRealGeneMutation(mutation_rate::Float64, mutation_interval::Tuple{T,T})
Defines the mutation of genes of real values.
Currently only Float64
and Integer
types (including Bool
) are supported. Mutation is applied for each gene on its own with probability mutation_rate
. On mutation a value from the uniform distribution in the interval mutation_interval
is drawn and added to the gene. Boolian genes are inverted.
GeneticAlgorithms.RealGeneMutation
— Method(c::RealGeneMutation{T})(chromosome::Chromosome{T})::Chromosome{T} where {T<:Bool}
Applies the mutation to the given chromosome
if the chromosome is of type Bool
.
GeneticAlgorithms.RealGeneMutation
— Method(c::RealGeneMutation{T})(chromosome::Chromosome{T})::Chromosome{T} where {T<:Float64}
Applies the mutation to the given chromosome
if the chromosome is of type Float64
.
GeneticAlgorithms.RealGeneMutation
— Method(c::RealGeneMutation{T})(chromosome::Chromosome{T})::Chromosome{T} where {T<:Integer}
Applies the mutation to the given chromosome
if the chromosome is of type Integer
.
GeneticAlgorithms.SudokuMutation
— TypeSudokuMutation(mutation_rate::Float64, initial::Vector{Vector{Int64}})
Mutation method for Sudoku puzzles.
The mutation is applied column-wise with probability mutation_rate
. initial
contains the initial sudoku grid and must be of size 9x9. The mutation ensures that the initial cells of initial
are not changed and the remaining values are shuffled.
GeneticAlgorithms.SudokuMutation
— Method(c::SudokuMutation)(chromosome::Chromosome{Vector{Int64}})::Chromosome{Vector{Int64}}
Applies the Sudoku mutation to the given chromosome
.