Skip to main content

MutationOperator

Trait MutationOperator 

Source
pub trait MutationOperator<G: EvolutionaryGenome>: Send + Sync {
    // Required method
    fn mutate<R: Rng>(&self, genome: &mut G, rng: &mut R);

    // Provided method
    fn mutation_probability(&self) -> f64 { ... }
}
Expand description

Mutation operator trait

Applies random changes to a genome.

Required Methods§

Source

fn mutate<R: Rng>(&self, genome: &mut G, rng: &mut R)

Apply mutation to a genome in place

Provided Methods§

Source

fn mutation_probability(&self) -> f64

Get the mutation probability per gene

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§