pub struct UtilityScore(/* private fields */);Expand description
Fixed-point utility used only for deterministic ordering.
The value is not a probability. It is calculated as
gain * confidence * business_value / cost / risk using the integer units
exposed by each input type.
Implementations§
Source§impl UtilityScore
impl UtilityScore
Sourcepub const MIN_POSITIVE: Self
pub const MIN_POSITIVE: Self
Smallest positive utility accepted by a default planning context.
Sourcepub const fn from_units(units: u64) -> Self
pub const fn from_units(units: u64) -> Self
Creates a threshold or persisted score from raw utility units.
Trait Implementations§
Source§impl Clone for UtilityScore
impl Clone for UtilityScore
Source§fn clone(&self) -> UtilityScore
fn clone(&self) -> UtilityScore
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for UtilityScore
Source§impl Debug for UtilityScore
impl Debug for UtilityScore
Source§impl<'de> Deserialize<'de> for UtilityScore
impl<'de> Deserialize<'de> for UtilityScore
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for UtilityScore
Source§impl Hash for UtilityScore
impl Hash for UtilityScore
Source§impl Ord for UtilityScore
impl Ord for UtilityScore
Source§fn cmp(&self, other: &UtilityScore) -> Ordering
fn cmp(&self, other: &UtilityScore) -> Ordering
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
Source§impl PartialEq for UtilityScore
impl PartialEq for UtilityScore
Source§impl PartialOrd for UtilityScore
impl PartialOrd for UtilityScore
Source§impl Serialize for UtilityScore
impl Serialize for UtilityScore
impl StructuralPartialEq for UtilityScore
Auto Trait Implementations§
impl Freeze for UtilityScore
impl RefUnwindSafe for UtilityScore
impl Send for UtilityScore
impl Sync for UtilityScore
impl Unpin for UtilityScore
impl UnsafeUnpin for UtilityScore
impl UnwindSafe for UtilityScore
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more