pub struct GaussianMutator { /* private fields */ }Expand description
The GaussianMutator is a simple mutator that adds a small amount of Gaussian noise to the gene.
This mutator is for use with any Chromosome which holds FloatGenes.
Implementations§
Source§impl GaussianMutator
impl GaussianMutator
Sourcepub fn new(rate: impl Into<Rate>) -> GaussianMutator
pub fn new(rate: impl Into<Rate>) -> GaussianMutator
Create a new instance of the GaussianMutator with the given rate.
The rate must be between 0.0 and 1.0.
Trait Implementations§
Source§impl Clone for GaussianMutator
impl Clone for GaussianMutator
Source§fn clone(&self) -> GaussianMutator
fn clone(&self) -> GaussianMutator
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for GaussianMutator
impl Debug for GaussianMutator
Source§impl<F, C> Mutate<C> for GaussianMutator
impl<F, C> Mutate<C> for GaussianMutator
fn rate(&self) -> Rate
fn mutate_chromosome( &mut self, chromosome: &mut C, ctx: &mut AlterContext<'_>, ) -> AlterResult
fn name(&self) -> String
fn alterer(self) -> Alterer<C>where
Self: Sized + 'static,
fn mutate( &mut self, population: &mut [Phenotype<C>], ctx: &mut AlterContext<'_>, ) -> AlterResult
fn mutate_genotype( &mut self, genotype: &mut Genotype<C>, ctx: &mut AlterContext<'_>, ) -> AlterResult
fn mutate_gene(&self, gene: &mut <C as Chromosome>::Gene) -> usize
Auto Trait Implementations§
impl Freeze for GaussianMutator
impl RefUnwindSafe for GaussianMutator
impl Send for GaussianMutator
impl Sync for GaussianMutator
impl Unpin for GaussianMutator
impl UnsafeUnpin for GaussianMutator
impl UnwindSafe for GaussianMutator
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more