pub struct EvolutionStats {
pub generations: Vec<GenerationStats>,
pub total_runtime_ms: f64,
pub termination_reason: Option<String>,
}Expand description
Statistics collector for an entire evolution run
Fields§
§generations: Vec<GenerationStats>Statistics per generation
total_runtime_ms: f64Total runtime in milliseconds
termination_reason: Option<String>Reason for termination
Implementations§
Source§impl EvolutionStats
impl EvolutionStats
Sourcepub fn record(&mut self, stats: GenerationStats)
pub fn record(&mut self, stats: GenerationStats)
Record a generation’s statistics
Sourcepub fn num_generations(&self) -> usize
pub fn num_generations(&self) -> usize
Get the number of generations recorded
Sourcepub fn best_fitness(&self) -> Option<f64>
pub fn best_fitness(&self) -> Option<f64>
Get the best fitness across all generations
Sourcepub fn final_best_fitness(&self) -> Option<f64>
pub fn final_best_fitness(&self) -> Option<f64>
Get the final best fitness
Sourcepub fn best_fitness_history(&self) -> Vec<f64>
pub fn best_fitness_history(&self) -> Vec<f64>
Get the history of best fitness values
Sourcepub fn mean_fitness_history(&self) -> Vec<f64>
pub fn mean_fitness_history(&self) -> Vec<f64>
Get the history of mean fitness values
Sourcepub fn diversity_history(&self) -> Vec<f64>
pub fn diversity_history(&self) -> Vec<f64>
Get the history of diversity values
Sourcepub fn set_termination_reason(&mut self, reason: &str)
pub fn set_termination_reason(&mut self, reason: &str)
Set the termination reason
Sourcepub fn set_runtime(&mut self, duration: Duration)
pub fn set_runtime(&mut self, duration: Duration)
Set the total runtime
Trait Implementations§
Source§impl Clone for EvolutionStats
impl Clone for EvolutionStats
Source§fn clone(&self) -> EvolutionStats
fn clone(&self) -> EvolutionStats
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 EvolutionStats
impl Debug for EvolutionStats
Source§impl Default for EvolutionStats
impl Default for EvolutionStats
Source§fn default() -> EvolutionStats
fn default() -> EvolutionStats
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for EvolutionStats
impl<'de> Deserialize<'de> for EvolutionStats
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
Auto Trait Implementations§
impl Freeze for EvolutionStats
impl RefUnwindSafe for EvolutionStats
impl Send for EvolutionStats
impl Sync for EvolutionStats
impl Unpin for EvolutionStats
impl UnsafeUnpin for EvolutionStats
impl UnwindSafe for EvolutionStats
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.