Enum Direction
pub enum Direction {
Minimize,
Maximize,
}Expand description
Which way is better for one objective.
Variants§
Implementations§
§impl Direction
impl Direction
pub fn is_better(self, candidate: f64, incumbent: f64) -> bool
pub fn is_better(self, candidate: f64, incumbent: f64) -> bool
true if candidate is strictly better than incumbent.
NaN is never better than anything, and nothing is better than NaN — a NaN objective cannot silently win a comparison.
pub const fn worst_value(self) -> f64
pub const fn worst_value(self) -> f64
The value that any real objective beats.
Trait Implementations§
impl Copy for Direction
§impl<'de> Deserialize<'de> for Direction
impl<'de> Deserialize<'de> for Direction
§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 Direction
§impl Ord for Direction
impl Ord for Direction
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
§impl PartialOrd for Direction
impl PartialOrd for Direction
impl StructuralPartialEq for Direction
Auto Trait Implementations§
impl Freeze for Direction
impl RefUnwindSafe for Direction
impl Send for Direction
impl Sync for Direction
impl Unpin for Direction
impl UnsafeUnpin for Direction
impl UnwindSafe for Direction
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