#[non_exhaustive]pub struct Solution {
pub state: Option<State>,
pub objective: f64,
pub decision_variables: Vec<DecisionVariable>,
pub evaluated_constraints: Vec<EvaluatedConstraint>,
pub evaluated_named_functions: Vec<EvaluatedNamedFunction>,
pub feasible: bool,
pub feasible_relaxed: Option<bool>,
pub feasible_unrelaxed: bool,
pub optimality: i32,
pub relaxation: i32,
pub sense: i32,
}Expand description
Solution with evaluated objective and constraints
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.state: Option<State>§objective: f64§decision_variables: Vec<DecisionVariable>§evaluated_constraints: Vec<EvaluatedConstraint>§evaluated_named_functions: Vec<EvaluatedNamedFunction>§feasible: boolThe feasibility of the solution for all, remaining and removed constraints.
The feasibility for the remaining constraints is represented by the feasible_relaxed field.
feasible_relaxed: Option<bool>Feasibility of the solution for remaining constraints, ignoring removed constraints.
This is optional due to the backward compatibility.
If this field is NULL, the feasible field represents relaxed feasibility,
and the deprecated feasible_unrelaxed field represents the feasibility including removed constraints.
feasible_unrelaxed: bool[DEPRECATED] Feasibility of the solution for all constraints.
This field has been introduced in Python SDK 1.6.0 and deprecated in 1.7.0.
The feasibility in this sense is represented by the feasible field after 1.7.0.
optimality: i32The optimality of the solution.
relaxation: i32Whether the solution is obtained by a relaxed linear programming solver.
sense: i32Whether the problem is a minimization or maximization problem.
Implementations§
Source§impl Solution
impl Solution
Sourcepub fn optimality(&self) -> Optimality
pub fn optimality(&self) -> Optimality
Returns the enum value of optimality, or the default if the field is set to an invalid enum value.
Sourcepub fn set_optimality(&mut self, value: Optimality)
pub fn set_optimality(&mut self, value: Optimality)
Sets optimality to the provided enum value.
Sourcepub fn relaxation(&self) -> Relaxation
pub fn relaxation(&self) -> Relaxation
Returns the enum value of relaxation, or the default if the field is set to an invalid enum value.
Sourcepub fn set_relaxation(&mut self, value: Relaxation)
pub fn set_relaxation(&mut self, value: Relaxation)
Sets relaxation to the provided enum value.
Sourcepub fn feasible_relaxed(&self) -> bool
pub fn feasible_relaxed(&self) -> bool
Returns the value of feasible_relaxed, or the default value if feasible_relaxed is unset.
Source§impl Solution
impl Solution
pub fn decision_variable_ids(&self) -> BTreeSet<u64>
pub fn constraint_ids(&self) -> BTreeSet<u64>
pub fn get_feasible_unrelaxed(&self) -> bool
pub fn get_feasible_relaxed(&self) -> bool
pub fn get_feasible(&self) -> bool
Trait Implementations§
Source§impl Message for Solution
impl Message for Solution
Source§fn encoded_len(&self) -> usize
fn encoded_len(&self) -> usize
Source§fn encode<B>(&self, buf: &mut B) -> Result<(), EncodeError>
fn encode<B>(&self, buf: &mut B) -> Result<(), EncodeError>
Source§fn encode_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
fn encode_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
Source§fn encode_length_delimited<B>(&self, buf: &mut B) -> Result<(), EncodeError>
fn encode_length_delimited<B>(&self, buf: &mut B) -> Result<(), EncodeError>
Source§fn encode_length_delimited_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
fn encode_length_delimited_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
Source§fn decode<B>(buf: B) -> Result<Self, DecodeError>
fn decode<B>(buf: B) -> Result<Self, DecodeError>
Source§fn decode_length_delimited<B>(buf: B) -> Result<Self, DecodeError>
fn decode_length_delimited<B>(buf: B) -> Result<Self, DecodeError>
Source§fn merge<B>(&mut self, buf: B) -> Result<(), DecodeError>
fn merge<B>(&mut self, buf: B) -> Result<(), DecodeError>
self. Read moreSource§fn merge_length_delimited<B>(&mut self, buf: B) -> Result<(), DecodeError>
fn merge_length_delimited<B>(&mut self, buf: B) -> Result<(), DecodeError>
self.impl StructuralPartialEq for Solution
Auto Trait Implementations§
impl Freeze for Solution
impl RefUnwindSafe for Solution
impl Send for Solution
impl Sync for Solution
impl Unpin for Solution
impl UnsafeUnpin for Solution
impl UnwindSafe for Solution
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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>
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>
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