pub struct MIPCtx<'a>(/* private fields */);Expand description
Callback context object during MIP.
Implementations§
Source§impl<'a> MIPCtx<'a>
impl<'a> MIPCtx<'a>
Sourcepub fn terminate(&self)
pub fn terminate(&self)
Signal Gurobi to terminate the optimisation. Will not take effect immediately
Sourcepub fn proceed(&mut self)
pub fn proceed(&mut self)
Generate a request to proceed to the next phase of the computation. Note that the request is only accepted in a few phases of the algorithm, and it won’t be acted upon immediately.
In the current Gurobi version, this callback allows you to proceed from the NoRel heuristic to the standard MIP
search. You can determine the current algorithm phase ctx.proceed() (in MIPCtx, MIPNodeCtx and MIPSolCtx).
Sourcepub fn set_solution<I, V, T>(&self, solution: I) -> Result<Option<f64>>
pub fn set_solution<I, V, T>(&self, solution: I) -> Result<Option<f64>>
Provide a new feasible solution for a MIP model. Not all variables need to be given. The return value on success has the following meaning, depending from on the callback context:
| Context | Possible Values | Meaning |
|---|---|---|
MIPNodeCtx | None | Suggested solution was not feasible. |
Some(val) | Suggested solution was feasible, has objective value of val. | |
MIPSolCtx | None | No information |
MIPCtx | None | No information |
On success, if the solution was feasible the method returns the computed objective value,
otherwise returns None.
Sourcepub fn open_scenarios(&self) -> Result<i32>
pub fn open_scenarios(&self) -> Result<i32>
Number of scenarios that are still open in a multi-scenario model.