ilog.concert
Interface IloModel

All Known Subinterfaces:
IloModeler, IloMPModeler

public interface IloModel
extends IloAddable

This interface defines the API for classes that represent optimization models. An IloModel extractable is a multiple set of modeling objects, such as constraints or objectives. Objects of type IloAddable can be added to and removed from an IloModel. The modeling objects in a model can be queried using the iterator returned by method iterator().

An important point is that optimizers such as IloSolverFactory 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().


Method Summary
 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 IloModel.
 
Methods inherited from interface ilog.concert.IloAddable
getName, setName
 

Method Detail

add

public IloAddable add(IloAddable object)
               throws IloException
This method adds the extractable object to the invoking model.
Parameters:
object - The modeling object to be added to the invoking IloModel.
Returns:
The modeling object that has been added.

add

public IloAddable[] add(IloAddable[] objects)
                 throws IloException
This method adds the array of extractable objects to the invoking model.
Parameters:
objects - The array of modeling objects to be added to the invoking IloModel.
Returns:
The array of modeling objects that have been added.

add

public IloAddable[] add(IloAddable[] objects,
                        int start,
                        int num)
                 throws IloException
This method adds modeling objects to the invoking IloModel. All objects implementing the IloAddable interface objects[start]...objects[start+num-1] are added to the invoking IloModel object.
Parameters:
objects - 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.
Returns:
The array of modeling objects that have been added.

remove

public IloAddable remove(IloAddable object)
                  throws IloException
This method removes the extractable object from the invoking model. If the modeling object has been added multiple times, only one instance is removed from the model.
Parameters:
object - The modeling object to be removed from the invoking IloModel.

remove

public IloAddable[] remove(IloAddable[] objects)
                    throws IloException
This method removes the array of extractable objects from the invoking model.
Parameters:
objects - The array of modeling objects to be removed from the invoking IloModel.

remove

public IloAddable[] remove(IloAddable[] objects,
                           int start,
                           int num)
                    throws IloException
This method removes modeling objects from the invoking IloModel. The modeling objects or, more precisely, the objects implementing the IloAddable interface objects[start]...objects[start+num-1] are removed from the invoking IloModel object. If a modeling object has been added multiple times, only one instance is removed from the model.
Parameters:
objects - 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.

iterator

public java.util.Iterator iterator()
This method returns an iterator that traverses the objects in the model. Any manipulation of the model will render an iterator accessed with this method invalid. An iterator can only be used until the method add, remove or the method delete is called on the invoking IloModel.