Trait genevo::operator::MutationOp
[−]
[src]
pub trait MutationOp<G>: GeneticOperator where
G: Genotype, { fn mutate<R>(&self, genome: G, rng: &mut R) -> G
where
R: Rng + Sized; }
A MutationOp
defines a function of how a genetic::Genotype
mutates. It
is used to maintain genetic diversity from one generation of a population
of genetic algorithm genotypes to the next. It is analogous to biological
mutation. Mutation alters one or more gene values in a chromosome from its
initial state. In mutation, the solution may change entirely from the
previous solution. Hence GA can come to a better solution by using
mutation. Mutation occurs during evolution according to a user-definable
mutation probability. This probability should be set low. If it is set too
high, the search will turn into a primitive random search.
Required Methods
fn mutate<R>(&self, genome: G, rng: &mut R) -> G where
R: Rng + Sized,
R: Rng + Sized,
Mutates the given 'Genotype' and returns it as a new 'Genotype'.
Implementors
impl<G> MutationOp<G> for RandomValueMutator<G> where
G: Genotype + RandomGenomeMutation,impl<G> MutationOp<G> for BreederValueMutator<G> where
G: Genotype + BreederGenomeMutation,impl<V> MutationOp<Vec<V>> for InsertOrderMutator where
V: Clone + Debug + PartialEq + Send + Sync,impl<V> MutationOp<Vec<V>> for SwapOrderMutator where
V: Clone + Debug + PartialEq + Send + Sync,