pub enum VarDoubleAttr {
Show 22 variants
ScenNX,
BarX,
LB,
Obj,
ObjN,
PStart,
RC,
SALBLow,
SALBUp,
SAObjLow,
SAObjUp,
SAUBLow,
SAUBUp,
ScenNLB,
ScenNObj,
ScenNUB,
Start,
UB,
UnbdRay,
VarHintVal,
X,
Xn,
}Variants§
ScenNX
- Modifiable: No
- Type: double (
f64)
When the model has multiple scenarios, this attribute is used to query the variable value in the current solution of scenario $n$. You set $n$ using the ScenarioNumber parameter.
The number of scenarios in the model can be queried (or modified) using the NumScenarios attribute.
Please refer to the Multiple Scenarios discussion for more information.
BarX
- Modifiable: No
- Type: double (
f64)
The variable value in the best barrier iterate (before crossover). Only available when the barrier algorithm was selected.
LB
- Modifiable: Yes
- Type: double (
f64)
Variable lower bound. Note that any value less than -1e20 is treated as negative infinity.
Obj
- Modifiable: Yes
- Type: double (
f64)
Linear objective coefficient. In our object-oriented interfaces, you typically use the setObjective method to set the objective, but this attribute provides an alternative for setting or modifying linear objective terms.
Note that this attribute interacts with our piecewise-linear objective feature. If you set a piecewise-linear objective
function for a variable, that will automatically set the Obj attribute to zero. Similarly, if you set the Obj
attribute for a variable, that will automatically delete any previously specified piecewise-linear objective.
ObjN
- Modifiable: Yes
- Type: double (
f64)
When the model has multiple objectives, this attribute is used to query or modify objective coefficients for objective
$n$. You set $n$ using the ObjNumber parameter. Note that when ObjNumber is equal to 0, ObjN is equivalent to Obj.
The number of objectives in the model can be queried (or modified) using the NumObj attribute.
Please refer to the discussion of Multiple Objectives for more information on the use of alternative objectives.
PStart
- Modifiable: Yes
- Type: double (
f64)
The current simplex start vector. If you set PStart values for every variable in the model and DStart values for
every constraint, then simplex will use those values to compute a warm start basis. If you’d like to retract a
previously specified start, set any PStart value to GRB_UNDEFINED.
Note that any model modifications which are pending or are made after setting PStart (adding variables or constraints,
changing coefficients, etc.) will discard the start. You should only set this attribute after you are done modifying
your model.
Note also that you’ll get much better performance if you warm start your linear program using a simplex basis (using
VBasis and CBasis). The PStart attribute should only be used in situations where you don’t have a basis or you don’t
want to disable presolve.
If you’d like to provide a feasible starting solution for a MIP model, you should input it using the Start attribute.
Only affects LP models; it will be ignored for QP, QCP, or MIP models.
Note that if you provide a valid starting extreme point, either through PStart, DStart, or through VBasis, CBasis, then LP presolve will be disabled by default. For models where presolve greatly reduces the problem size, this might hurt performance. To allow presolve, it needs to set parameter LPWarmStart to 2.
RC
- Modifiable: No
- Type: double (
f64)
The reduced cost in the current solution. Only available for convex, continuous models.
SALBLow
- Modifiable: No
- Type: double (
f64)
Lower bound sensitivity information: smallest lower bound value at which the current optimal basis would remain optimal. Only available for basic solutions.
SALBUp
- Modifiable: No
- Type: double (
f64)
Lower bound sensitivity information: largest lower bound value at which the current optimal basis would remain optimal. Only available for basic solutions.
SAObjLow
- Modifiable: No
- Type: double (
f64)
Objective coefficient sensitivity information: smallest objective value at which the current optimal basis would remain optimal. Only available for basic solutions.
SAObjUp
- Modifiable: No
- Type: double (
f64)
Objective coefficient sensitivity information: largest objective value at which the current optimal basis would remain optimal. Only available for basic solutions.
SAUBLow
- Modifiable: No
- Type: double (
f64)
Upper bound sensitivity information: smallest upper bound value at which the current optimal basis would remain optimal. Only available for basic solutions.
SAUBUp
- Modifiable: No
- Type: double (
f64)
Upper bound sensitivity information: largest upper bound value at which the current optimal basis would remain optimal. Only available for basic solutions.
ScenNLB
- Modifiable: Yes
- Type: double (
f64)
When the model has multiple scenarios, this attribute is used to query or modify changes of the variable lower bounds in scenario $n$ w.r.t. the base model. You set $n$ using the ScenarioNumber parameter.
If an element of this array attribute is set to the undefined value (GRB_UNDEFINED in C and C++, or GRB.UNDEFINED in Java, .NET, and Python), it means that the corresponding value in the scenario is identical to the one in the base model.
The number of scenarios in the model can be queried (or modified) using the NumScenarios attribute.
Please refer to the Multiple Scenarios discussion for more information.
ScenNObj
- Modifiable: Yes
- Type: double (
f64)
When the model has multiple scenarios, this attribute is used to query or modify changes of the variable objective coefficients in scenario $n$ w.r.t. the base model. You set $n$ using the ScenarioNumber parameter.
If an element of this array attribute is set to the undefined value (GRB_UNDEFINED in C and C++, or GRB.UNDEFINED in Java, .NET, and Python), it means that the corresponding value in the scenario is identical to the one in the base model.
The number of scenarios in the model can be queried (or modified) using the NumScenarios attribute.
Please refer to the Multiple Scenarios discussion for more information.
ScenNUB
- Modifiable: Yes
- Type: double (
f64)
When the model has multiple scenarios, this attribute is used to query or modify changes of the variable upper bounds in scenario $n$ w.r.t. the base model. You set $n$ using the ScenarioNumber parameter.
If an element of this array attribute is set to the undefined value (GRB_UNDEFINED in C and C++, or GRB.UNDEFINED in Java, .NET, and Python), it means that the corresponding value in the scenario is identical to the one in the base model.
The number of scenarios in the model can be queried (or modified) using the NumScenarios attribute.
Please refer to the Multiple Scenarios discussion for more information.
Start
- Modifiable: Yes
- Type: double (
f64)
The current MIP start vector. The MIP solver will attempt to build an initial solution from this vector when it is
available. Note that the start can be partially populated – the MIP solver will attempt to fill in values for missing
start values. If you wish to leave the start value for a variable undefined, you can either avoid setting the Start
attribute for that variable, or you can set it to a special undefined value (GRB_UNDEFINED in C and C++, or
GRB.UNDEFINED in Java, .NET, and Python).
If the Gurobi MIP solver log indicates that your MIP start didn’t produce a new incumbent solution, note that there can be multiple explanations. One possibility is that your MIP start is infeasible. Another, more common possibility is that one of the Gurobi heuristics found a solution that is as good as the solution produced by the MIP start, so the MIP start solution was cut off. Finally, if you specified a partial MIP start, it is possible that the limited MIP exploration done on this partial start was insufficient to find a new incumbent solution. You can try setting the StartNodeLimit parameter to a larger value if you want Gurobi to work harder to try to complete the partial start.
If you solve a sequence of models, where one is built by modifying the previous one, and if you don’t provide a MIP
start, then Gurobi will try to construct one automatically from the solution of the previous model. If you don’t want it
to try this, you should reset the model before starting the subsequent solve. If you provided a MIP start but would
prefer to use the previous solution as the start instead, you should clear your start (by setting the Start attribute
to undefined for all variables).
If you have multiple start vectors, you can provide them to Gurobi by using the Start attribute in combination with
the NumStart attribute and the StartNumber parameter. Specifically, use the NumStart attribute to indicate how many
start vectors you will supply. Then set the StartNumber parameter to a value between 0 and NumStart-1 to indicate which
start you are supplying. For each value of StartNumber, populate the Start attribute to supply that start. Gurobi will
use all of the provided starts. As an alternative, you can append new MIP start vectors to your model by setting the
StartNumber parameter to -1. In this case, whenever you read a MIP start, or use a function to set a MIP start value for
a set of variables, a new MIP start will be created, the parameter NumStart will be increased, and any unspecified
variable will be left as undefined.
If you want to diagnose an infeasible MIP start, you can try fixing the variables in the model to their values in your MIP start (by setting their lower and upper bound attributes). If the resulting MIP model is infeasible, you can then compute an IIS on this model to get additional information that should help to identify the cause of the infeasibility.
Only affects MIP models.
UB
- Modifiable: Yes
- Type: double (
f64)
Variable upper bound. Note that any value greater than 1e20 is treated as infinite.
UnbdRay
- Modifiable: No
- Type: double (
f64)
Unbounded ray (for unbounded linear models only). Provides a vector that, when added to any feasible solution, yields a new solution that is also feasible but improves the objective. Only available when parameter InfUnbdInfo is set to 1.
VarHintVal
- Modifiable: Yes
- Type: double (
f64)
A set of user hints. If you know that a variable is likely to take a particular value in high quality solutions of a MIP
model, you can provide that value as a hint. You can also (optionally) provide information about your level of
confidence in a hint with the VarHintPri attribute.
The Gurobi MIP solver will use these variable hints in a number of different ways. Hints will affect the heuristics that Gurobi uses to find feasible solutions, and the branching decisions that Gurobi makes to explore the MIP search tree. In general, high quality hints should produce high quality MIP solutions faster. In contrast, low quality hints will lead to some wasted effort, but shouldn’t lead to dramatic performance degradations.
Variables hints and MIP starts are similar in concept, but they behave in very different ways. If you specify a MIP start, the Gurobi MIP solver will try to build a single feasible solution from the provided set of variable values. If you know a solution, you should use a MIP start to provide it to the solver. In contrast, variable hints provide guidance to the MIP solver that affects the entire solution process. If you have a general sense of the likely values for variables, you should provide them through variable hints.
If you wish to leave the hint value for a variable undefined, you can either avoid setting the VarHintVal attribute
for that variable, or you can set it to a special undefined value (GRB_UNDEFINED in C and C++, GRB.UNDEFINED in Java,
.NET, and Python, NA in R or nan in Matlab).
Note that deleting variables from your model will cause several attributes to be discarded (variable hints and branch priorities). If you’d like them to persist, your program will need to repopulate them after deleting the variables and making a subsequent model update call.
Only affects MIP models.
X
Xn
- Modifiable: No
- Type: double (
f64)
The variable value in a sub-optimal MIP solution. Use parameter SolutionNumber to indicate which alternate solution to
retrieve. Solutions are sorted in order of worsening objective value. Thus, when SolutionNumber is 1, Xn returns the
second-best solution found. When SolutionNumber is equal to its default value of 0, querying attribute Xn is
equivalent to querying attribute X.
The number of sub-optimal solutions found during the MIP search will depend on the values of a few parameters. The most important of these are PoolSolutions, PoolSearchMode, and PoolGap. Please consult the section on Solution Pools for a more detailed discussion of this topic.
Trait Implementations§
Source§impl AsCStr for VarDoubleAttr
impl AsCStr for VarDoubleAttr
Source§impl Clone for VarDoubleAttr
impl Clone for VarDoubleAttr
Source§fn clone(&self) -> VarDoubleAttr
fn clone(&self) -> VarDoubleAttr
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more