pub struct ObjectiveSpec {
pub direction: ObjectiveDirection,
pub metric: String,
pub weight: f64,
}Expand description
Objective specification
Fields§
§direction: ObjectiveDirectionObjective direction
metric: StringName of the metric to optimize
weight: f64Weight for multi-objective (1.0 for single)
Implementations§
Source§impl ObjectiveSpec
impl ObjectiveSpec
Sourcepub fn with_weight(self, weight: f64) -> Self
pub fn with_weight(self, weight: f64) -> Self
Set weight for multi-objective optimization
Sourcepub fn is_minimize(&self) -> bool
pub fn is_minimize(&self) -> bool
Check if this is a minimization objective
Trait Implementations§
Source§impl Clone for ObjectiveSpec
impl Clone for ObjectiveSpec
Source§fn clone(&self) -> ObjectiveSpec
fn clone(&self) -> ObjectiveSpec
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 ObjectiveSpec
impl Debug for ObjectiveSpec
Source§impl<'de> Deserialize<'de> for ObjectiveSpec
impl<'de> Deserialize<'de> for ObjectiveSpec
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
Auto Trait Implementations§
impl Freeze for ObjectiveSpec
impl RefUnwindSafe for ObjectiveSpec
impl Send for ObjectiveSpec
impl Sync for ObjectiveSpec
impl Unpin for ObjectiveSpec
impl UnsafeUnpin for ObjectiveSpec
impl UnwindSafe for ObjectiveSpec
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