Struct EmptyEnv

Source
pub struct EmptyEnv { /* private fields */ }
Expand description

Gurobi environment object (see the Gurobi manual) A Gurobi environment which hasn’t been started yet. Some Gurobi parameters, such as Record need to be set before the environment has been started.

Setting param::OutputFlag to 0 on an EmptyEnv is useful for stopping the license info from being printed, since this happens on starting the environment.

§Examples

use grb::*;
let mut env = Env::empty()?;
env.set(param::OutputFlag, 0)? // license will not be printed when env starts
  .set(param::UpdateMode, 1)?
  .set(param::LogFile, "".to_string())?;
let env : Env = env.start()?;

Implementations§

Source§

impl EmptyEnv

Source

pub fn get<P: ParamGet<V>, V>(&self, param: P) -> Result<V>

Query a parameter value

Source

pub fn set<P: ParamSet<V>, V>( &mut self, param: P, value: V, ) -> Result<&mut Self>

Set a parameter value

Source

pub fn start(self) -> Result<Env>

Start the environment, returning the Env on success.

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