NO FRAMES

Class IloModel

Definition file: ilconcert/ilomodel.h
Class for models.

An instance of this class represents a model. A model consists of the extractable objects such as constraints, constrained variables, objectives, and possibly other modeling objects, that represent a problem. Concert Technology extracts information from a model and passes the information in an appropriate form to algorithms that solve the problem. (For information about extracting objects into algorithms, see the member function IloAlgorithm::extract and the template IloAdd.)

Most member functions in this class contain assert statements. For an explanation of the macro NDEBUG (a way to turn on or turn off these assert statements), see the concept Assert and NDEBUG.

Models and Submodels

With Concert Technology, you may create more than one model in a given environment (an instance of IloEnv). In fact, you can create submodels. That is, you can add one model to another model within the same environment.

What Is Extracted from a Model

All the extractable objects (that is, instances of IloExtractable or one of its subclasses) that have been added to a model (an instance of IloModel) and that have not been removed from it will be extracted when an algorithm extracts the model. An instance of the nested class IloModel::Iterator accesses those extractable objects.

See Also:

Constructor Summary
public IloModel()
public IloModel(IloModelI * impl)
public IloModel(const IloEnv env, const char * name=0)
Method Summary
public const IloExtractableArray &add(const IloExtractableArray & x) const
public IloExtractableadd(const IloExtractable x) const
public IloModelI *getImpl() const
public voidremove(const IloExtractableArray x) const
public voidremove(const IloExtractable x) const
Inherited Methods from IloExtractable
asConstraint, asIntExpr, asModel, asNumExpr, asObjective, asVariable, end, getEnv, getId, getImpl, getName, getObject, isConstraint, isIntExpr, isModel, isNumExpr, isObjective, isVariable, setName, setObject
Inner Class
IloModel::Iterator Nested class of iterators to traverse the extractable objects in a model.
Constructor Detail

IloModel

public IloModel()
This constructor creates an empty handle. You must initialize it before you use it.

IloModel

public IloModel(IloModelI * impl)
This constructor creates a handle object from a pointer to an implementation object.

IloModel

public IloModel(const IloEnv env, const char * name=0)

This constructor creates a model. By default, the name of the model is the empty string, but you can attribute a name to the model at its creation.


Method Detail

add

public const IloExtractableArray & add(const IloExtractableArray & x) const

This member function adds the array of extractable objects to the invoking model.

Note
The member function add notifies Concert Technology algorithms about this addition to the model.

add

public IloExtractable add(const IloExtractable x) const

This member function adds the extractable object to the invoking model.

Note
The member function add notifies Concert Technology algorithms about this addition to the model.

getImpl

public IloModelI * getImpl() const
This member function returns a pointer to the implementation object of the invoking handle.

remove

public void remove(const IloExtractableArray x) const

This member function removes the array of extractable objects from the invoking model.

Note
The member function remove notifies Concert Technology algorithms about this removal from the model.

remove

public void remove(const IloExtractable x) const

This member function removes the extractable object from the invoking model.

Note
The member function remove notifies Concert Technology algorithms about this removal from the model.