pub struct SoftScore { /* private fields */ }Expand description
A simple score with a single integer value.
This is the simplest score type, useful when there’s only one type of constraint to optimize.
§Examples
use solverforge_core::{SoftScore, Score};
let score1 = SoftScore::of(-5);
let score2 = SoftScore::of(-3);
assert!(score2 > score1); // -3 is better than -5
assert!(!score1.is_feasible()); // Negative scores are not feasibleImplementations§
Trait Implementations§
Source§impl Ord for SoftScore
impl Ord for SoftScore
Source§impl ParseableScore for SoftScore
impl ParseableScore for SoftScore
Source§impl PartialOrd for SoftScore
impl PartialOrd for SoftScore
Source§impl Score for SoftScore
impl Score for SoftScore
Source§fn is_feasible(&self) -> bool
fn is_feasible(&self) -> bool
Returns true if this score represents a feasible solution. Read more
Source§fn levels_count() -> usize
fn levels_count() -> usize
Returns the number of score levels. Read more
Source§fn from_level_numbers(levels: &[i64]) -> Self
fn from_level_numbers(levels: &[i64]) -> Self
Creates a score from level numbers. Read more
Source§fn level_label(index: usize) -> ScoreLevel
fn level_label(index: usize) -> ScoreLevel
Returns the semantic label for the score level at the given index. Read more
Source§fn compare(&self, other: &Self) -> Ordering
fn compare(&self, other: &Self) -> Ordering
Compares two scores, returning the ordering. Read more
Source§fn is_better_than(&self, other: &Self) -> bool
fn is_better_than(&self, other: &Self) -> bool
Returns true if this score is better than the other score. Read more
Source§fn is_worse_than(&self, other: &Self) -> bool
fn is_worse_than(&self, other: &Self) -> bool
Returns true if this score is worse than the other score.
Source§fn is_equal_to(&self, other: &Self) -> bool
fn is_equal_to(&self, other: &Self) -> bool
Returns true if this score is equal to the other score.
impl Copy for SoftScore
impl Eq for SoftScore
impl StructuralPartialEq for SoftScore
Auto Trait Implementations§
impl Freeze for SoftScore
impl RefUnwindSafe for SoftScore
impl Send for SoftScore
impl Sync for SoftScore
impl Unpin for SoftScore
impl UnsafeUnpin for SoftScore
impl UnwindSafe for SoftScore
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