Struct genetic_algorithm::mutate::MutateMultiGeneDynamic  
source · pub struct MutateMultiGeneDynamic {
    pub number_of_mutations: usize,
    pub mutation_probability: f32,
    pub mutation_probability_step: f32,
    pub target_cardinality: usize,
}Expand description
Selects Chromosomes in the Population with the dynamically updated mutation_probability. Then mutates the selected chromosomes the provided number of times, where the Genotype determines whether this is random, relative or scaled. The mutation probability is dynamically increased or decreased to achieve a target population cardinality.
Duplicate mutations of the same gene are allowed, as disallowing duplicates is relatively expensive and mutations should be quite small, so there is little chance for conflict.
Useful when a single mutation would generally not lead to improvement, because the problem space behaves more like a UniqueGenotype where genes must be swapped (but the UniqueGenotype doesn’t map to the problem space well). Set number_of_mutations to two in that situation.
Fields§
§number_of_mutations: usize§mutation_probability: f32§mutation_probability_step: f32§target_cardinality: usizeImplementations§
Trait Implementations§
source§impl Clone for MultiGeneDynamic
 
impl Clone for MultiGeneDynamic
source§fn clone(&self) -> MultiGeneDynamic
 
fn clone(&self) -> MultiGeneDynamic
1.0.0 · source§fn clone_from(&mut self, source: &Self)
 
fn clone_from(&mut self, source: &Self)
source. Read moresource§impl Debug for MultiGeneDynamic
 
impl Debug for MultiGeneDynamic
source§impl Default for MultiGeneDynamic
 
impl Default for MultiGeneDynamic
source§fn default() -> MultiGeneDynamic
 
fn default() -> MultiGeneDynamic
source§impl From<MultiGeneDynamic> for Wrapper
 
impl From<MultiGeneDynamic> for Wrapper
source§fn from(mutate: MutateMultiGeneDynamic) -> Self
 
fn from(mutate: MutateMultiGeneDynamic) -> Self
source§impl Mutate for MultiGeneDynamic
 
impl Mutate for MultiGeneDynamic
fn call<G: EvolveGenotype, R: Rng, SR: StrategyReporter<Genotype = G>>( &mut self, genotype: &mut G, state: &mut EvolveState<G>, config: &EvolveConfig, reporter: &mut SR, rng: &mut R, )
Auto Trait Implementations§
impl Freeze for MultiGeneDynamic
impl RefUnwindSafe for MultiGeneDynamic
impl Send for MultiGeneDynamic
impl Sync for MultiGeneDynamic
impl Unpin for MultiGeneDynamic
impl UnwindSafe for MultiGeneDynamic
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
source§impl<T> CloneToUninit for Twhere
    T: Clone,
 
impl<T> CloneToUninit for Twhere
    T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
 
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit)source§impl<T> IntoEither for T
 
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
 
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
 
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more