pub struct ScrambleMutator { /* private fields */ }Expand description
The ScrambleMutator is a simple mutator that scrambles a random section of the [Chromosome].
Because the slice of the chromosome is of random length, with small chromosomes, the scrambling may not be very effective. This mutator is best used with larger [Chromosome]s.
Implementations§
Source§impl ScrambleMutator
impl ScrambleMutator
pub fn new(rate: impl Into<Expr>) -> ScrambleMutator
Trait Implementations§
Source§impl Clone for ScrambleMutator
impl Clone for ScrambleMutator
Source§fn clone(&self) -> ScrambleMutator
fn clone(&self) -> ScrambleMutator
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 ScrambleMutator
impl Debug for ScrambleMutator
Source§impl<C> Mutate<C> for ScrambleMutatorwhere
C: ContiguousChromosome,
impl<C> Mutate<C> for ScrambleMutatorwhere
C: ContiguousChromosome,
fn rates(&self) -> RateSet
fn mutate_chromosome( &mut self, chromosome: &mut C, ctx: &mut AlterContext<'_>, ) -> usize
fn name(&self) -> String
fn into_alterer(self) -> Alterer<C>where
Self: Sized + 'static,
fn mutate( &mut self, population: &mut [Phenotype<C>], ctx: &mut AlterContext<'_>, ) -> usize
Auto Trait Implementations§
impl Freeze for ScrambleMutator
impl RefUnwindSafe for ScrambleMutator
impl Send for ScrambleMutator
impl Sync for ScrambleMutator
impl Unpin for ScrambleMutator
impl UnsafeUnpin for ScrambleMutator
impl UnwindSafe for ScrambleMutator
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