public interface IloModel extends IloAddable
IloModel extractable is a set of multiple modeling objects,
such as constraints or objectives. Objects of type IloAddable
can be added to and removed from an instance of IloModel.
The modeling
objects in a model can be queried by the iterator returned by the method
iterator.
An important point is that optimizers such as
IloCP or
IloCplex implement the IloModel interface
through its extension IloModeler. The model associated with
an optimizer is the model the optimizer will solve upon invocation of its
method solve.
| Modifier and Type | Method and Description |
|---|---|
IloAddable |
add(IloAddable object)
This method adds the extractable object to the invoking
model.
|
IloAddable[] |
add(IloAddable[] objects)
This method adds the array of extractable objects to the invoking
model.
|
IloAddable[] |
add(IloAddable[] objects,
int start,
int num)
This method adds modeling objects to the invoking
IloModel. |
java.util.Iterator |
iterator()
This method returns an iterator that traverses the objects in
the model.
|
IloAddable |
remove(IloAddable object)
This method removes the extractable object from the invoking
model.
|
IloAddable[] |
remove(IloAddable[] objects)
This method removes the array of extractable objects
from the invoking model.
|
IloAddable[] |
remove(IloAddable[] objects,
int start,
int num)
This method removes modeling objects from the
invoking instance of
IloModel. |
getName, setNameIloAddable add(IloAddable object) throws IloException
IloExceptionobject - The modeling object to be added to the
invoking IloModel.IloAddable[] add(IloAddable[] objects) throws IloException
IloExceptionobjects - The array of modeling objects to be added to the
invoking IloModel.IloAddable[] add(IloAddable[] objects, int start, int num) throws IloException
IloModel.
All objects implementing the IloAddable interface
objects[start]...objects[start+num-1] are added to
the invoking IloModel object.IloExceptionobjects - The array of modeling objects to be added
to the invoking IloModel.start - The first modeling object to be added to the
invoking IloModel.num - The number of modeling objects to be added to
the invoking IloModel.IloAddable remove(IloAddable object) throws IloException
If the modeling object has been added multiple times, only one instance is removed from the model.
IloExceptionobject - The modeling object to be removed from the invoking
IloModel.IloAddable[] remove(IloAddable[] objects) throws IloException
IloExceptionobjects - The array of modeling objects to be removed from the
invoking IloModel.IloAddable[] remove(IloAddable[] objects, int start, int num) throws IloException
IloModel.
The modeling objects or, more precisely, the objects implementing
the IloAddable interface
objects[start]...objects[start+num-1] are removed
from the invoking instance of IloModel. If a modeling object
has been added multiple times, only one instance is removed
from the model.
IloExceptionobjects - The array of modeling objects to be removed
from the invoking IloModel.start - The first modeling object to be removed from the
invoking IloModel.num - The number of modeling objects to be removed from
the invoking IloModel.java.util.Iterator iterator()
add, remove or
the method delete is called on the invoking
IloModel.