Skip to main content

Solution

Struct Solution 

Source
#[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
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional 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: bool

The 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

[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: i32

The optimality of the solution.

§relaxation: i32

Whether the solution is obtained by a relaxed linear programming solver.

§sense: i32

Whether the problem is a minimization or maximization problem.

Implementations§

Source§

impl Solution

Source

pub fn optimality(&self) -> Optimality

Returns the enum value of optimality, or the default if the field is set to an invalid enum value.

Source

pub fn set_optimality(&mut self, value: Optimality)

Sets optimality to the provided enum value.

Source

pub fn relaxation(&self) -> Relaxation

Returns the enum value of relaxation, or the default if the field is set to an invalid enum value.

Source

pub fn set_relaxation(&mut self, value: Relaxation)

Sets relaxation to the provided enum value.

Source

pub fn feasible_relaxed(&self) -> bool

Returns the value of feasible_relaxed, or the default value if feasible_relaxed is unset.

Source

pub fn sense(&self) -> Sense

Returns the enum value of sense, or the default if the field is set to an invalid enum value.

Source

pub fn set_sense(&mut self, value: Sense)

Sets sense to the provided enum value.

Source§

impl Solution

Trait Implementations§

Source§

impl Clone for Solution

Source§

fn clone(&self) -> Solution

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Solution

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for Solution

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl From<Solution> for Solution

Source§

fn from(solution: Solution) -> Self

Converts to this type from the input type.
Source§

impl Message for Solution

Source§

fn encoded_len(&self) -> usize

Returns the encoded length of the message without a length delimiter.
Source§

fn clear(&mut self)

Clears the message, resetting all fields to their default.
Source§

fn encode<B>(&self, buf: &mut B) -> Result<(), EncodeError>
where B: BufMut, Self: Sized,

Encodes the message to a buffer. Read more
Source§

fn encode_to_vec(&self) -> Vec<u8>
where Self: Sized,

Encodes the message to a newly allocated buffer.
Source§

fn encode_length_delimited<B>(&self, buf: &mut B) -> Result<(), EncodeError>
where B: BufMut, Self: Sized,

Encodes the message with a length-delimiter to a buffer. Read more
Source§

fn encode_length_delimited_to_vec(&self) -> Vec<u8>
where Self: Sized,

Encodes the message with a length-delimiter to a newly allocated buffer.
Source§

fn decode<B>(buf: B) -> Result<Self, DecodeError>
where B: Buf, Self: Default,

Decodes an instance of the message from a buffer. Read more
Source§

fn decode_length_delimited<B>(buf: B) -> Result<Self, DecodeError>
where B: Buf, Self: Default,

Decodes a length-delimited instance of the message from the buffer.
Source§

fn merge<B>(&mut self, buf: B) -> Result<(), DecodeError>
where B: Buf, Self: Sized,

Decodes an instance of the message from a buffer, and merges it into self. Read more
Source§

fn merge_length_delimited<B>(&mut self, buf: B) -> Result<(), DecodeError>
where B: Buf, Self: Sized,

Decodes a length-delimited instance of the message from buffer, and merges it into self.
Source§

impl Parse for Solution

Source§

type Output = Solution

Source§

type Context = ()

Source§

fn parse(self, _: &Self::Context) -> Result<Self::Output, ParseError>

Source§

fn parse_as( self, context: &Self::Context, message: &'static str, field: &'static str, ) -> Result<Self::Output, ParseError>

Source§

impl PartialEq for Solution

Source§

fn eq(&self, other: &Solution) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl StructuralPartialEq for Solution

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V