Mutation operators (a.k.a. mutators) work on a single individual and return a copy. Some of them have parameters to control how the mutation is performed, and are dependent on both the data contained in an individual and its representation.
Currently, mutation is only implemented for vector individuals.
All mutation operators have been renamed to mutators since EvoLP 1.4. The old names will be deprecated in a future major release. Be sure to check the new type ontology.
EvoLP provides many built-in mutators.
Bitwise mutation with probability
λ of flipping each bit.
Gaussian mutation with standard deviation
σ, which should be a real number.
Swap mutation for permutation-based individuals.
Insert mutation for permutation-based individuals.
Scramble mutation for permutation-based individuals.
Inversion mutation for permutation-based individuals.
After "instantiating" a mutation method, you can use
mutate on a single individual
ind. All operators return a copy, and in the process no individual is modified.
Randomly flips each bit with a probability
Randomly add Gaussian noise to the
ind candidate solution, with a standard deviation of
Randomly swap the position of two alleles in the
ind candidate solution.
Randomly choose two positions
ind, insert at
a+1 the element at position
b`, and shift the rest of the elements.
Randomly scramble the subsequence between two random points in
Invert the subsequence between two random points in