pub enum ReplacementStrategy {
ReplaceWorst,
ReplaceRandom,
ReplaceParent,
ReplaceIfBetter,
TournamentWorst(usize),
}Expand description
Replacement strategy for steady-state GA.
EV-42: only ReplacementStrategy::ReplaceIfBetter is elitist (it accepts an
offspring only when it improves on the individual it would replace). Every
other strategy performs its replacement unconditionally, matching its
documented meaning — in particular ReplaceRandom is a genuine, diversity-
preserving stochastic replacement and may accept a worse offspring.
Variants§
ReplaceWorst
Replace the worst individual in the population, unconditionally. Because the current best is never the replacement target, the population best is preserved, but the population mean may temporarily worsen.
ReplaceRandom
Replace a uniformly-random individual, unconditionally (non-elitist). A worse offspring can enter the population, preserving exploratory diversity.
ReplaceParent
Replace the worse parent, but only if the offspring beats it (generational replacement).
ReplaceIfBetter
Replace the worst individual, but only if the offspring is strictly better than it (the fully elitist, accept-if-better option).
TournamentWorst(usize)
Use an inverse tournament to choose a (likely poor) individual to replace, then replace it unconditionally.
Trait Implementations§
Source§impl Clone for ReplacementStrategy
impl Clone for ReplacementStrategy
Source§fn clone(&self) -> ReplacementStrategy
fn clone(&self) -> ReplacementStrategy
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ReplacementStrategy
impl Debug for ReplacementStrategy
Source§impl Default for ReplacementStrategy
impl Default for ReplacementStrategy
Source§fn default() -> ReplacementStrategy
fn default() -> ReplacementStrategy
Auto Trait Implementations§
impl Freeze for ReplacementStrategy
impl RefUnwindSafe for ReplacementStrategy
impl Send for ReplacementStrategy
impl Sync for ReplacementStrategy
impl Unpin for ReplacementStrategy
impl UnsafeUnpin for ReplacementStrategy
impl UnwindSafe for ReplacementStrategy
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
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> ⓘ
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> ⓘ
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§impl<T> Pointable for T
impl<T> Pointable for T
§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read more§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.