Struct genetic_algorithm::compete::CompeteTournament
source · pub struct CompeteTournament {
pub tournament_size: usize,
}Expand description
Run tournaments with randomly chosen chromosomes and pick a single winner. Do this target_population_size times until the required population level is reached. This approach kind of sorts the fitness first, but not very strictly. This preserves a level of diversity, which avoids local optimum lock-in.
Excess chromosomes, beyond the target_population_size, are dropped.
Fields§
§tournament_size: usizeImplementations§
Trait Implementations§
source§impl Clone for Tournament
impl Clone for Tournament
source§fn clone(&self) -> Tournament
fn clone(&self) -> Tournament
Returns a copy 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 Compete for Tournament
impl Compete for Tournament
fn call<G: Genotype, R: Rng, SR: EvolveReporter<Genotype = G>>( &mut self, state: &mut EvolveState<G>, config: &EvolveConfig, _reporter: &mut SR, rng: &mut R, )
source§impl Debug for Tournament
impl Debug for Tournament
source§impl From<Tournament> for Wrapper
impl From<Tournament> for Wrapper
source§fn from(compete: CompeteTournament) -> Self
fn from(compete: CompeteTournament) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for Tournament
impl RefUnwindSafe for Tournament
impl Send for Tournament
impl Sync for Tournament
impl Unpin for Tournament
impl UnwindSafe for Tournament
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§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
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>
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