pub struct Elitism { /* private fields */ }Expand description
Preserves the best n individuals from the current population.
When n is 1, returns the single best individual. For larger values,
uses partial sorting to efficiently find the top n without fully
sorting the population.
§Examples
use evolve::operators::sequential::selection::Elitism;
use std::num::NonZero;
// Keep the single best individual each generation
let elite = Elitism::default();
// Keep the top 5
let elite = Elitism::new(NonZero::new(5).unwrap());Implementations§
Trait Implementations§
Source§impl<G, F, Fe, R, C> GeneticOperator<G, F, Fe, R, C> for Elitism
impl<G, F, Fe, R, C> GeneticOperator<G, F, Fe, R, C> for Elitism
impl Copy for Elitism
Auto Trait Implementations§
impl Freeze for Elitism
impl RefUnwindSafe for Elitism
impl Send for Elitism
impl Sync for Elitism
impl Unpin for Elitism
impl UnsafeUnpin for Elitism
impl UnwindSafe for Elitism
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