pub struct MultiScore<'a> {
pub objectives: SmallVec<[ObjectiveScore; 8]>,
pub feedback: Option<Cow<'a, str>>,
pub confidence: f64,
}Expand description
A score with multiple named objective values.
Fields§
§objectives: SmallVec<[ObjectiveScore; 8]>Per-objective scores.
feedback: Option<Cow<'a, str>>Combined feedback from all objectives.
confidence: f64Aggregate confidence.
Implementations§
Source§impl<'a> MultiScore<'a>
impl<'a> MultiScore<'a>
Sourcepub fn new(objectives: SmallVec<[ObjectiveScore; 8]>) -> Self
pub fn new(objectives: SmallVec<[ObjectiveScore; 8]>) -> Self
Create from individual objective scores.
Sourcepub fn scalarize(&self, strategy: &Scalarization) -> Score<'static>
pub fn scalarize(&self, strategy: &Scalarization) -> Score<'static>
Scalarize to a single Score using the given strategy.
Sourcepub fn dominates(&self, other: &MultiScore<'_>) -> bool
pub fn dominates(&self, other: &MultiScore<'_>) -> bool
Check if this score dominates another (Pareto dominance).
Sourcepub fn all_targets_met(&self, objectives: &[Objective]) -> bool
pub fn all_targets_met(&self, objectives: &[Objective]) -> bool
Check if all objectives meet their individual targets.
Trait Implementations§
Source§impl<'a> Clone for MultiScore<'a>
impl<'a> Clone for MultiScore<'a>
Source§fn clone(&self) -> MultiScore<'a>
fn clone(&self) -> MultiScore<'a>
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 moreAuto Trait Implementations§
impl<'a> Freeze for MultiScore<'a>
impl<'a> RefUnwindSafe for MultiScore<'a>
impl<'a> Send for MultiScore<'a>
impl<'a> Sync for MultiScore<'a>
impl<'a> Unpin for MultiScore<'a>
impl<'a> UnsafeUnpin for MultiScore<'a>
impl<'a> UnwindSafe for MultiScore<'a>
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