pub enum ConvergenceReason {
FitnessStagnation {
generations: usize,
},
LowDiversity {
diversity: u64,
},
TargetReached {
target: u64,
},
MaxGenerations {
generations: usize,
},
MaxEvaluations {
evaluations: usize,
},
RhatConverged {
rhat: u64,
},
MultipleReasons(Vec<ConvergenceReason>),
Custom(String),
}Expand description
Reason for convergence
Variants§
FitnessStagnation
Fitness has not improved for many generations
LowDiversity
Population diversity is below threshold
TargetReached
Target fitness reached
MaxGenerations
Maximum generations reached
MaxEvaluations
Maximum evaluations reached
RhatConverged
R-hat statistic indicates convergence
MultipleReasons(Vec<ConvergenceReason>)
Multiple criteria satisfied
Custom(String)
Custom termination
Implementations§
Source§impl ConvergenceReason
impl ConvergenceReason
Sourcepub fn fitness_stagnation(generations: usize) -> Self
pub fn fitness_stagnation(generations: usize) -> Self
Create a fitness stagnation reason
Sourcepub fn low_diversity(diversity: f64) -> Self
pub fn low_diversity(diversity: f64) -> Self
Create a low diversity reason
Sourcepub fn target_reached(target: f64) -> Self
pub fn target_reached(target: f64) -> Self
Create a target reached reason
Sourcepub fn rhat_converged(rhat: f64) -> Self
pub fn rhat_converged(rhat: f64) -> Self
Create an R-hat converged reason
Trait Implementations§
Source§impl Clone for ConvergenceReason
impl Clone for ConvergenceReason
Source§fn clone(&self) -> ConvergenceReason
fn clone(&self) -> ConvergenceReason
Returns a duplicate 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 Debug for ConvergenceReason
impl Debug for ConvergenceReason
Source§impl<'de> Deserialize<'de> for ConvergenceReason
impl<'de> Deserialize<'de> for ConvergenceReason
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
Source§impl PartialEq for ConvergenceReason
impl PartialEq for ConvergenceReason
Source§impl Serialize for ConvergenceReason
impl Serialize for ConvergenceReason
impl Eq for ConvergenceReason
impl StructuralPartialEq for ConvergenceReason
Auto Trait Implementations§
impl Freeze for ConvergenceReason
impl RefUnwindSafe for ConvergenceReason
impl Send for ConvergenceReason
impl Sync for ConvergenceReason
impl Unpin for ConvergenceReason
impl UnsafeUnpin for ConvergenceReason
impl UnwindSafe for ConvergenceReason
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§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§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>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read more§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
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
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.