Trait grb::ModelObject[][src]

pub trait ModelObject: ModelObjectPrivate + Debug {
    fn id(&self) -> u32;
}

This trait encompasses all Gurobi model objects: Var, Constr, QConstr and SOS. Each ModelObject is associated with a particular model, and can only be used with that model. Each ModelObject also has a unique, fixed 32-bit ID. Gurobi itself uses an i32 to index objects (only positive indices are used), so the 32-bit limitation is already there. Note that IDs are only guaranteed to be unique if the concrete types of the ModelObject are the same and the objects belong to the same model. For example, if v is a Var and c is a Constr, then v and c may have the same ID. Additionally, if s is also a Var, but doesn’t belong to the same Model as v, s and v may have the same ID.

Required methods

fn id(&self) -> u32[src]

Retrieve the object’s ID.

Loading content...

Implementors

impl ModelObject for Constr[src]

impl ModelObject for QConstr[src]

impl ModelObject for SOS[src]

impl ModelObject for Var[src]

Loading content...