pub struct Tarpeian<S> { /* private fields */ }Expand description
Tarpeian bloat control (Poli 2003): a selection in which some of the genomes larger than the population’s mean size count as invalid.
Once per call, each genome larger than the mean Genome::len (a tree’s number of nodes)
is marked with probability rate, independently, and select then chooses as if the marked
individuals were invalid: worse than every other. The more individuals above the mean, the
more are held back, whatever the scale of the fitness values.
Poli marks new individuals before they’re evaluated and skips their evaluation. As a selection, this keeps the effect on selection, not the saved evaluations, which would need the algorithm’s cooperation.
use genoxide::prelude::*;
let select = Tarpeian::new(Tournament::new(7)?, 0.3)?;
assert_eq!(select.rate(), 0.3);
assert!(Tarpeian::new(Tournament::new(7)?, 0.0).is_err());Implementations§
Trait Implementations§
Source§impl<'de, S> Deserialize<'de> for Tarpeian<S>where
S: Deserialize<'de>,
Available on crate feature serde only.
impl<'de, S> Deserialize<'de> for Tarpeian<S>where
S: Deserialize<'de>,
Available on crate feature
serde only.Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl<S: PartialEq> StructuralPartialEq for Tarpeian<S>
Auto Trait Implementations§
impl<S> Freeze for Tarpeian<S>where
S: Freeze,
impl<S> RefUnwindSafe for Tarpeian<S>where
S: RefUnwindSafe,
impl<S> Send for Tarpeian<S>where
S: Send,
impl<S> Sync for Tarpeian<S>where
S: Sync,
impl<S> Unpin for Tarpeian<S>where
S: Unpin,
impl<S> UnsafeUnpin for Tarpeian<S>where
S: UnsafeUnpin,
impl<S> UnwindSafe for Tarpeian<S>where
S: UnwindSafe,
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
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