pub struct DecisionVariableAnalysis { /* private fields */ }
Expand description
The result of analyzing the decision variables in an instance.
§Responsibility
This struct is responsible for
-
Serving kind-based and usage-based partitioning of decision variables to solvers. Solvers only want to know the mathematical properties of the optimization problem. They do not need to know the details of the instance, such as the names of the decision variables and constraints, removed constraints or fixed variables which does not affect the optimization problem itself.
-
Validating the state returned by solvers, and populating the variables which does not passed to the solvers.
- The state by solvers is valid if:
- It contains every
Self::used
decision variables. Other IDs are allowed as long as consistent with the population result. - The values for each decision variable are within the bounds.
- It contains every
Self::populate
checks the state is valid, and populates the state as follows:- For
Self::fixed
ID, the fixed value is used. - For
Self::irrelevant
ID,Bound::nearest_to_zero
is used as the value. - For
Self::dependent
ID, the value is evaluated from other IDs.
- For
- The state by solvers is valid if:
§Invariants
- Every IDs are subset of
Self::all
. - (kind-based partitioning)
Self::binary
,Self::integer
,Self::continuous
,Self::semi_integer
, andSelf::semi_continuous
are disjoint, and their union is equal toSelf::all
. - (usage-based partitioning) The union of
Self::used_in_objective
andSelf::used_in_constraints
(=Self::used
),Self::fixed
, andSelf::dependent
are disjoint each other. Remaining decision variables areSelf::irrelevant
.
Implementations§
Source§impl DecisionVariableAnalysis
impl DecisionVariableAnalysis
Sourcepub fn all(&self) -> &VariableIDSet
pub fn all(&self) -> &VariableIDSet
The IDs of all decision variables
pub fn binary(&self) -> &Bounds
pub fn integer(&self) -> &Bounds
pub fn continuous(&self) -> &Bounds
pub fn semi_integer(&self) -> &Bounds
pub fn semi_continuous(&self) -> &Bounds
Sourcepub fn used_in_objective(&self) -> &VariableIDSet
pub fn used_in_objective(&self) -> &VariableIDSet
The set of decision variables that are used in the objective function.
Sourcepub fn used_in_constraints(&self) -> &BTreeMap<ConstraintID, VariableIDSet>
pub fn used_in_constraints(&self) -> &BTreeMap<ConstraintID, VariableIDSet>
The set of decision variables that are used in the constraints.
Sourcepub fn used(&self) -> &VariableIDSet
pub fn used(&self) -> &VariableIDSet
The set of decision variables that are used in the objective function or constraints.
Sourcepub fn fixed(&self) -> &BTreeMap<VariableID, f64>
pub fn fixed(&self) -> &BTreeMap<VariableID, f64>
Fixed decision variables
Sourcepub fn irrelevant(&self) -> &BTreeMap<VariableID, (Kind, Bound)>
pub fn irrelevant(&self) -> &BTreeMap<VariableID, (Kind, Bound)>
The set of decision variables that are not used in the objective or constraints and are not fixed or dependent.
Source§impl DecisionVariableAnalysis
impl DecisionVariableAnalysis
pub fn used_binary(&self) -> Bounds
pub fn used_integer(&self) -> Bounds
pub fn used_continuous(&self) -> Bounds
pub fn used_semi_integer(&self) -> Bounds
pub fn used_semi_continuous(&self) -> Bounds
Trait Implementations§
Source§impl AbsDiffEq for DecisionVariableAnalysis
Check if used decision variables has the same bounds
impl AbsDiffEq for DecisionVariableAnalysis
Check if used decision variables has the same bounds
Other decision variables e.g. fixed
are ignored.
Source§fn default_epsilon() -> Self::Epsilon
fn default_epsilon() -> Self::Epsilon
Source§fn abs_diff_eq(&self, other: &Self, epsilon: Self::Epsilon) -> bool
fn abs_diff_eq(&self, other: &Self, epsilon: Self::Epsilon) -> bool
§fn abs_diff_ne(&self, other: &Rhs, epsilon: Self::Epsilon) -> bool
fn abs_diff_ne(&self, other: &Rhs, epsilon: Self::Epsilon) -> bool
AbsDiffEq::abs_diff_eq
].Source§impl Clone for DecisionVariableAnalysis
impl Clone for DecisionVariableAnalysis
Source§fn clone(&self) -> DecisionVariableAnalysis
fn clone(&self) -> DecisionVariableAnalysis
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for DecisionVariableAnalysis
impl Debug for DecisionVariableAnalysis
Source§impl PartialEq for DecisionVariableAnalysis
impl PartialEq for DecisionVariableAnalysis
impl StructuralPartialEq for DecisionVariableAnalysis
Auto Trait Implementations§
impl Freeze for DecisionVariableAnalysis
impl RefUnwindSafe for DecisionVariableAnalysis
impl Send for DecisionVariableAnalysis
impl Sync for DecisionVariableAnalysis
impl Unpin for DecisionVariableAnalysis
impl UnwindSafe for DecisionVariableAnalysis
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