pub struct ExtensionMassExtinction {
pub cardinality_threshold: usize,
pub survival_rate: f32,
pub elitism_rate: f32,
}
Expand description
Simulates a cambrian explosion. The controlling metric is population cardinality in the population after selection. When this cardinality drops to the threshold, the population is randomly reduced regardless of fitness using the survival_rate (fraction of population). The elitism_rate ensures the passing of the best chromosomes before random reduction starts (doesn’t care about best chromosome uniqueness).
Population will recover in the following generations
Fields§
§cardinality_threshold: usize
§survival_rate: f32
§elitism_rate: f32
Implementations§
Trait Implementations§
Source§impl Clone for MassExtinction
impl Clone for MassExtinction
Source§fn clone(&self) -> MassExtinction
fn clone(&self) -> MassExtinction
Returns a duplicate of the value. Read more
1.0.0 · 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 MassExtinction
impl Debug for MassExtinction
Source§impl Extension for MassExtinction
impl Extension for MassExtinction
fn call<G: EvolveGenotype, R: Rng, SR: StrategyReporter<Genotype = G>>( &mut self, genotype: &G, state: &mut EvolveState<G>, config: &EvolveConfig, reporter: &mut SR, rng: &mut R, )
fn extract_elite_chromosomes<G: EvolveGenotype>( &self, _genotype: &G, state: &mut EvolveState<G>, config: &EvolveConfig, elitism_size: usize, ) -> Vec<Chromosome<G::Allele>>
fn extract_unique_elite_chromosomes<G: EvolveGenotype>( &self, _genotype: &G, state: &mut EvolveState<G>, config: &EvolveConfig, elitism_size: usize, ) -> Vec<Chromosome<G::Allele>>
fn extract_unique_chromosomes<G: EvolveGenotype>( &self, _genotype: &G, state: &mut EvolveState<G>, _config: &EvolveConfig, ) -> Vec<Chromosome<G::Allele>>
Source§impl From<MassExtinction> for Wrapper
impl From<MassExtinction> for Wrapper
Source§fn from(extension: ExtensionMassExtinction) -> Self
fn from(extension: ExtensionMassExtinction) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for MassExtinction
impl RefUnwindSafe for MassExtinction
impl Send for MassExtinction
impl Sync for MassExtinction
impl Unpin for MassExtinction
impl UnwindSafe for MassExtinction
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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>
Converts
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>
Converts
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