Struct gurobi::model::Model
[−]
[src]
pub struct Model<'a> {
// some fields omitted
}A Gurobi model object associated with certain environment.
Methods
impl<'a> Model<'a>[src]
fn new(env: &'a Env, model: *mut GRBmodel) -> Model<'a>
create an empty model which associated with certain environment.
fn update(&mut self) -> Result<()>
apply all modification of the model to process.
fn copy(&self) -> Result<Model>
create a copy of the model
fn optimize(&mut self) -> Result<()>
optimize the model.
fn write(&self, filename: &str) -> Result<()>
write information of the model to file.
fn add_var(&mut self, name: &str, vtype: VarType) -> Result<Var>
add a decision variable to the model.
fn add_constr(&mut self, name: &str, expr: LinExpr, sense: ConstrSense, rhs: f64) -> Result<Constr>
add a linear constraint to the model.
fn add_qconstr(&mut self, constrname: &str, expr: QuadExpr, sense: ConstrSense, rhs: f64) -> Result<QConstr>
add a quadratic constraint to the model.
fn add_sos(&mut self, vars: &[Var], weights: &[f64], sostype: SOSType) -> Result<SOS>
add Special Order Set (SOS) constraint to the model.
fn set_objective<Expr: Into<QuadExpr>>(&mut self, expr: Expr, sense: ModelSense) -> Result<()>
Set the objective function of the model.
fn get<A: Attr>(&self, attr: A) -> Result<A::Out>
Query the value of attributes which associated with variable/constraints.
fn set<A: Attr>(&mut self, attr: A, val: A::Out) -> Result<()>
Set the value of attributes which associated with variable/constraints.
fn get_values<A: AttrArray, P: Proxy>(&self, attr: A, item: &[P]) -> Result<Vec<A::Out>>
Query the value of attributes which associated with variable/constraints.
fn set_values<A: AttrArray, P: Proxy>(&mut self, attr: A, item: &[P], val: &[A::Out]) -> Result<()>
Set the value of attributes which associated with variable/constraints.
fn feas_relax(&mut self, feasobjtype: FeasType, minrelax: bool, vars: &[Var], constrs: &[Constr], lbpen: &[f64], ubpen: &[f64], rhspen: &[f64]) -> Result<(f64, Iter<Var>, Iter<Constr>, Iter<QConstr>)>
Modify the model to create a feasibility relaxation.
fn compute_iis(&mut self) -> Result<()>
Compute an Irreducible Inconsistent Subsystem (IIS) of the model.
fn status(&self) -> Result<Status>
Retrieve the status of the model.
fn get_vars(&self) -> Iter<Var>
Retrieve an iterator of the variables in the model.
fn get_constrs(&self) -> Iter<Constr>
Retrieve an iterator of the linear constraints in the model.
fn get_qconstrs(&self) -> Iter<QConstr>
Retrieve an iterator of the quadratic constraints in the model.
fn get_sos(&self) -> Iter<SOS>
Retrieve an iterator of the special order set (SOS) constraints in the model.
fn remove_var(&mut self, item: Var) -> Result<()>
Remove a variable from the model.
fn remove_constr(&mut self, item: Constr) -> Result<()>
Remove a linear constraint from the model.
fn remove_qconstr(&mut self, item: QConstr) -> Result<()>
Remove a quadratic constraint from the model.
fn remove_sos(&mut self, item: SOS) -> Result<()>
Remove a special order set (SOS) cnstraint from the model.