Struct MIPCtx

Source
pub struct MIPCtx<'a>(/* private fields */);
Expand description

Callback context object during MIP.

Implementations§

Source§

impl<'a> MIPCtx<'a>

Source

pub fn terminate(&self)

Signal Gurobi to terminate the optimisation. Will not take effect immediately

Source

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).

Source

pub fn set_solution<I, V, T>(&self, solution: I) -> Result<Option<f64>>
where V: Borrow<Var>, T: Borrow<f64>, I: IntoIterator<Item = (V, T)>,

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:

ContextPossible ValuesMeaning
MIPNodeCtxNoneSuggested solution was not feasible.
Some(val)Suggested solution was feasible, has objective value of val.
MIPSolCtxNoneNo information
MIPCtxNoneNo information

On success, if the solution was feasible the method returns the computed objective value, otherwise returns None.

Source

pub fn runtime(&self) -> Result<f64>

Retrieve the elapsed solver runtime in seconds.

Source

pub fn open_scenarios(&self) -> Result<i32>

Number of scenarios that are still open in a multi-scenario model.

Source

pub fn obj_best(&self) -> Result<f64>

Current best objective.

Source

pub fn obj_bnd(&self) -> Result<f64>

Current best objective bound.

Source

pub fn node_cnt(&self) -> Result<f64>

Current explored node count.

Source

pub fn sol_cnt(&self) -> Result<i32>

Current count of feasible solutions found.

Source

pub fn cut_cnt(&self) -> Result<i32>

Current count of cutting planes applied.

Source

pub fn node_left(&self) -> Result<f64>

Current unexplored node count.

Source

pub fn iter_cnt(&self) -> Result<f64>

Current simplex iteration count.

Source

pub fn phase(&self) -> Result<MipPhase>

Current algorithmic phase in the MIP solution

Auto Trait Implementations§

§

impl<'a> Freeze for MIPCtx<'a>

§

impl<'a> RefUnwindSafe for MIPCtx<'a>

§

impl<'a> !Send for MIPCtx<'a>

§

impl<'a> !Sync for MIPCtx<'a>

§

impl<'a> Unpin for MIPCtx<'a>

§

impl<'a> UnwindSafe for MIPCtx<'a>

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> 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, 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.