pub struct Alterer<C: Chromosome> { /* private fields */ }Expand description
The Alterer struct is used to represent the different types of alterations that can be performed on a population - It can be either a mutation or a crossover operation.
Implementations§
Source§impl<C: Chromosome> Alterer<C>
impl<C: Chromosome> Alterer<C>
pub fn mutation(name: &'static str, rate: Rate, m: Arc<dyn Mutate<C>>) -> Self
pub fn crossover( name: &'static str, rate: Rate, c: Arc<dyn Crossover<C>>, ) -> Self
pub fn rate(&self) -> &Rate
pub fn name(&self) -> &str
pub fn alter( &mut self, population: &mut [Phenotype<C>], metrics: &mut MetricSet, generation: usize, )
Trait Implementations§
Auto Trait Implementations§
impl<C> !RefUnwindSafe for Alterer<C>
impl<C> !UnwindSafe for Alterer<C>
impl<C> Freeze for Alterer<C>
impl<C> Send for Alterer<C>
impl<C> Sync for Alterer<C>
impl<C> Unpin for Alterer<C>
impl<C> UnsafeUnpin for Alterer<C>
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