pub struct Metrics {
pub best_fitnesses: Vec<f64>,
pub avg_fitnesses: Vec<f64>,
pub iterations: u32,
pub gens_without_improvement: u32,
pub step_times: HashMap<Steps, (bool, Instant, u128)>,
/* private fields */
}Fields§
§best_fitnesses: Vec<f64>§avg_fitnesses: Vec<f64>§iterations: u32§gens_without_improvement: u32§step_times: HashMap<Steps, (bool, Instant, u128)>Implementations§
Source§impl Metrics
impl Metrics
pub fn new() -> Self
pub fn record(&mut self, best_fitness: f64, avg_fitness: f64)
pub fn start_clock(&mut self)
pub fn end_clock(&mut self)
pub fn step_start(&mut self, step: Steps)
pub fn step_end(&mut self, step: Steps)
pub fn step_time(&self, step: Steps) -> Option<Duration>
pub fn total_time(&self) -> u128
pub fn plot_chart( &self, path: &String, test_name: &String, ) -> Result<(), Box<dyn Error>>
Auto Trait Implementations§
impl Freeze for Metrics
impl RefUnwindSafe for Metrics
impl Send for Metrics
impl Sync for Metrics
impl Unpin for Metrics
impl UnwindSafe for Metrics
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> 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