pub struct SolverStats {
pub step_count: u64,
pub moves_evaluated: u64,
pub moves_accepted: u64,
pub score_calculations: u64,
/* private fields */
}Expand description
Solver-level statistics.
Tracks aggregate metrics across all phases of a solve run.
§Example
use solverforge_solver::stats::SolverStats;
let mut stats = SolverStats::default();
stats.start();
stats.record_step();
stats.record_move(true);
stats.record_move(false);
assert_eq!(stats.step_count, 1);
assert_eq!(stats.moves_evaluated, 2);
assert_eq!(stats.moves_accepted, 1);Fields§
§step_count: u64Total steps taken across all phases.
moves_evaluated: u64Total moves evaluated across all phases.
moves_accepted: u64Total moves accepted across all phases.
score_calculations: u64Total score calculations performed.
Implementations§
Source§impl SolverStats
impl SolverStats
Sourcepub fn record_move(&mut self, accepted: bool)
pub fn record_move(&mut self, accepted: bool)
Records a move evaluation and whether it was accepted.
Sourcepub fn record_step(&mut self)
pub fn record_step(&mut self)
Records a step completion.
Sourcepub fn record_score_calculation(&mut self)
pub fn record_score_calculation(&mut self)
Records a score calculation.
Sourcepub fn moves_per_second(&self) -> f64
pub fn moves_per_second(&self) -> f64
Returns the moves per second rate.
Sourcepub fn acceptance_rate(&self) -> f64
pub fn acceptance_rate(&self) -> f64
Returns the acceptance rate (accepted / evaluated).
Trait Implementations§
Source§impl Debug for SolverStats
impl Debug for SolverStats
Source§impl Default for SolverStats
impl Default for SolverStats
Source§fn default() -> SolverStats
fn default() -> SolverStats
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for SolverStats
impl RefUnwindSafe for SolverStats
impl Send for SolverStats
impl Sync for SolverStats
impl Unpin for SolverStats
impl UnwindSafe for SolverStats
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> 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