pub struct SlackConfig {
pub enabled: bool,
pub penalty: Option<f64>,
}Expand description
Slack variable configuration for a generic constraint.
When enabled is true, a slack variable is added to the LP so that the
constraint can be violated at a cost. This prevents infeasibility when
bounds are tight or conflicting. The penalty cost enters the LP objective
function.
penalty must be Some(value) with a positive value when enabled is
true, and None when enabled is false.
Fields§
§enabled: boolWhether a slack variable is added to allow soft violation of the constraint.
penalty: Option<f64>Penalty cost per unit of constraint violation. None when enabled is false.
Trait Implementations§
Source§impl Clone for SlackConfig
impl Clone for SlackConfig
Source§fn clone(&self) -> SlackConfig
fn clone(&self) -> SlackConfig
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 SlackConfig
impl Debug for SlackConfig
Source§impl PartialEq for SlackConfig
impl PartialEq for SlackConfig
impl StructuralPartialEq for SlackConfig
Auto Trait Implementations§
impl Freeze for SlackConfig
impl RefUnwindSafe for SlackConfig
impl Send for SlackConfig
impl Sync for SlackConfig
impl Unpin for SlackConfig
impl UnsafeUnpin for SlackConfig
impl UnwindSafe for SlackConfig
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