pub struct DynamicScore {
pub hard: i64,
pub medium: i64,
pub soft: i64,
}Expand description
Dynamic score used by host-language bindings.
The static Score trait requires a static level count, so every family
shares one three-level value: unused levels stay zero, and
HardSoftDecimal levels hold values scaled by 100 000. Equality, ordering,
and hashing compare the levels only. The declared family is a property of
the solve, not of the value; see scoped_dynamic_score_family.
Fields§
§hard: i64§medium: i64§soft: i64Implementations§
Trait Implementations§
Source§impl Add for DynamicScore
impl Add for DynamicScore
Source§impl Clone for DynamicScore
impl Clone for DynamicScore
impl Copy for DynamicScore
Source§impl Debug for DynamicScore
impl Debug for DynamicScore
Source§impl Default for DynamicScore
impl Default for DynamicScore
Source§impl Display for DynamicScore
impl Display for DynamicScore
impl Eq for DynamicScore
Source§impl Hash for DynamicScore
impl Hash for DynamicScore
Source§impl Neg for DynamicScore
impl Neg for DynamicScore
Source§impl Ord for DynamicScore
impl Ord for DynamicScore
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
1.21.0 (const: unstable) · Source§fn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the minimum of two values. Read more
Source§impl ParseableScore for DynamicScore
impl ParseableScore for DynamicScore
Source§fn parse(s: &str) -> Result<Self, ScoreParseError>
fn parse(s: &str) -> Result<Self, ScoreParseError>
Parses a score in the active family’s units. A decimal literal
(1.5soft) is always scaled; whole-number parts are scaled too when
the active family is HardSoftDecimal, so parsing inverts Display.
fn to_string_repr(&self) -> String
Source§impl PartialEq for DynamicScore
impl PartialEq for DynamicScore
Source§impl PartialOrd for DynamicScore
impl PartialOrd for DynamicScore
Source§impl Score for DynamicScore
impl Score for DynamicScore
fn is_feasible(&self) -> bool
fn zero() -> Self
fn levels_count() -> usize
fn level_number(&self, index: usize) -> i64
fn from_level_numbers(levels: &[i64]) -> Self
fn multiply(&self, multiplicand: f64) -> Self
fn divide(&self, divisor: f64) -> Self
fn abs(&self) -> Self
fn to_scalar(&self) -> f64
fn level_label(index: usize) -> ScoreLevel
fn to_level_numbers(&self) -> Vec<i64>
fn compare(&self, other: &Self) -> Ordering
fn is_better_than(&self, other: &Self) -> bool
fn is_worse_than(&self, other: &Self) -> bool
fn is_equal_to(&self, other: &Self) -> bool
fn one_hard() -> Self
fn one_soft() -> Self
fn one_medium() -> Self
impl StructuralPartialEq for DynamicScore
Auto Trait Implementations§
impl Freeze for DynamicScore
impl RefUnwindSafe for DynamicScore
impl Send for DynamicScore
impl Sync for DynamicScore
impl Unpin for DynamicScore
impl UnsafeUnpin for DynamicScore
impl UnwindSafe for DynamicScore
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<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.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