pub enum SelectionMethod {
Tournament {
size: usize,
},
RouletteWheel,
RankBased {
pressure: f64,
},
}Expand description
Selection method to use.
Variants§
Tournament
Tournament selection with given tournament size.
RouletteWheel
Roulette wheel (fitness-proportionate) selection.
RankBased
Rank-based selection: linear ranking with selective pressure.
Implementations§
Source§impl SelectionMethod
impl SelectionMethod
Sourcepub fn tournament() -> Self
pub fn tournament() -> Self
Default tournament selection (size 3).
Sourcepub fn rank_based() -> Self
pub fn rank_based() -> Self
Default rank-based (pressure 1.5).
Trait Implementations§
Source§impl Clone for SelectionMethod
impl Clone for SelectionMethod
Source§impl Debug for SelectionMethod
impl Debug for SelectionMethod
Source§impl Selection for SelectionMethod
impl Selection for SelectionMethod
Source§fn select(
&self,
pop: &TernaryPopulation,
n: usize,
rng: &mut SimpleRng,
) -> Vec<TernaryAgent>
fn select( &self, pop: &TernaryPopulation, n: usize, rng: &mut SimpleRng, ) -> Vec<TernaryAgent>
Select
n parents from the population.Auto Trait Implementations§
impl Freeze for SelectionMethod
impl RefUnwindSafe for SelectionMethod
impl Send for SelectionMethod
impl Sync for SelectionMethod
impl Unpin for SelectionMethod
impl UnsafeUnpin for SelectionMethod
impl UnwindSafe for SelectionMethod
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