pub struct HardMediumSoftScore { /* private fields */ }Expand description
A score with hard, medium, and soft constraint levels.
Hard constraints must be satisfied for feasibility. Medium constraints have higher priority than soft constraints. Soft constraints are the lowest priority optimization objectives.
Comparison order: hard > medium > soft
§Examples
use solverforge_core::HardMediumSoftScore;
let score1 = HardMediumSoftScore::of(0, -10, -100);
let score2 = HardMediumSoftScore::of(0, -5, -200);
// Better medium score wins even with worse soft score
assert!(score2 > score1);Implementations§
Source§impl HardMediumSoftScore
impl HardMediumSoftScore
Sourcepub const ZERO: HardMediumSoftScore
pub const ZERO: HardMediumSoftScore
The zero score.
Sourcepub const ONE_HARD: HardMediumSoftScore
pub const ONE_HARD: HardMediumSoftScore
One hard constraint penalty.
Sourcepub const ONE_MEDIUM: HardMediumSoftScore
pub const ONE_MEDIUM: HardMediumSoftScore
One medium constraint penalty.
Sourcepub const ONE_SOFT: HardMediumSoftScore
pub const ONE_SOFT: HardMediumSoftScore
One soft constraint penalty.
Trait Implementations§
Source§impl Add for HardMediumSoftScore
impl Add for HardMediumSoftScore
Source§impl Clone for HardMediumSoftScore
impl Clone for HardMediumSoftScore
Source§fn clone(&self) -> HardMediumSoftScore
fn clone(&self) -> HardMediumSoftScore
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 HardMediumSoftScore
impl Debug for HardMediumSoftScore
Source§impl Default for HardMediumSoftScore
impl Default for HardMediumSoftScore
Source§fn default() -> HardMediumSoftScore
fn default() -> HardMediumSoftScore
Returns the “default value” for a type. Read more
Source§impl Display for HardMediumSoftScore
impl Display for HardMediumSoftScore
Source§impl Hash for HardMediumSoftScore
impl Hash for HardMediumSoftScore
Source§impl Neg for HardMediumSoftScore
impl Neg for HardMediumSoftScore
Source§impl Ord for HardMediumSoftScore
impl Ord for HardMediumSoftScore
Source§impl ParseableScore for HardMediumSoftScore
impl ParseableScore for HardMediumSoftScore
Source§impl PartialEq for HardMediumSoftScore
impl PartialEq for HardMediumSoftScore
Source§impl PartialOrd for HardMediumSoftScore
impl PartialOrd for HardMediumSoftScore
Source§impl Score for HardMediumSoftScore
impl Score for HardMediumSoftScore
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 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.
Source§impl Sub for HardMediumSoftScore
impl Sub for HardMediumSoftScore
impl Copy for HardMediumSoftScore
impl Eq for HardMediumSoftScore
impl StructuralPartialEq for HardMediumSoftScore
Auto Trait Implementations§
impl Freeze for HardMediumSoftScore
impl RefUnwindSafe for HardMediumSoftScore
impl Send for HardMediumSoftScore
impl Sync for HardMediumSoftScore
impl Unpin for HardMediumSoftScore
impl UnwindSafe for HardMediumSoftScore
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