pub struct FitnessReport {
pub overall: f64,
pub metrics: HashMap<String, f64>,
}Expand description
Result of fitness evaluation with multiple metrics
Fields§
§overall: f64Overall fitness score (0.0-1.0)
metrics: HashMap<String, f64>Individual metric scores
Implementations§
Source§impl FitnessReport
impl FitnessReport
Sourcepub fn from_weighted(
metrics: HashMap<String, f64>,
weights: &HashMap<String, f64>,
) -> Self
pub fn from_weighted( metrics: HashMap<String, f64>, weights: &HashMap<String, f64>, ) -> Self
Create from individual metrics with weights
§Example
use vex_core::fitness::FitnessReport;
use std::collections::HashMap;
let mut metrics = HashMap::new();
metrics.insert("accuracy".to_string(), 0.9);
metrics.insert("coherence".to_string(), 0.8);
let mut weights = HashMap::new();
weights.insert("accuracy".to_string(), 0.6);
weights.insert("coherence".to_string(), 0.4);
let report = FitnessReport::from_weighted(metrics, &weights);
assert!((report.overall - 0.86).abs() < 0.01);Sourcepub fn add_metric(&mut self, name: &str, score: f64)
pub fn add_metric(&mut self, name: &str, score: f64)
Add a metric to the report
Sourcepub fn recalculate_overall(&mut self)
pub fn recalculate_overall(&mut self)
Recalculate overall from metrics with equal weights
Trait Implementations§
Source§impl Clone for FitnessReport
impl Clone for FitnessReport
Source§fn clone(&self) -> FitnessReport
fn clone(&self) -> FitnessReport
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 FitnessReport
impl Debug for FitnessReport
Source§impl Default for FitnessReport
impl Default for FitnessReport
Source§fn default() -> FitnessReport
fn default() -> FitnessReport
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for FitnessReport
impl RefUnwindSafe for FitnessReport
impl Send for FitnessReport
impl Sync for FitnessReport
impl Unpin for FitnessReport
impl UnwindSafe for FitnessReport
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,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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