12.07.2015 Views

ILOG CPLEX 11.0 User's Manual

ILOG CPLEX 11.0 User's Manual

ILOG CPLEX 11.0 User's Manual

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Modeling an Optimization Problem with Concert TechnologyAn optimization problem is represented by a set of interconnected modeling objects in aninstance of IloCplex or IloCplexModeler. Modeling objects in Concert Technology areobjects of type IloNumVar and its extensions, or IloAddable and its extensions. Sincethese are Java interfaces and not classes, objects of these types cannot be created explicitly.Rather, modeling objects are created using methods of an instance of IloModeler or oneof its extensions, such as IloMPModeler or IloCPModeler.Notes:The class IloCplex extends IloCplexModeler. All the modeling methods in IloCplex derivefrom IloCplexModeler. IloCplex implements the solving methods.The class IloCplexModeler, which implements IloMPModeler, makes it possible for a userto build models in a Java application as pure Java objects, without using the classIloCplex.In particular, a model built with IloCplexModeler using no instance of IloCplex does notrequire loading of the <strong>CPLEX</strong>.dll nor any shared library.Furthermore, IloCplexModeler is serializable. For example, a user may develop a pureJava application that builds a model with IloCplexModeler and sends the model andmodeling objects off to an optimization server that uses IloCplex.The example CplexServer.java shows you how to write an optimization server that acceptspure Java model taking advantage of the class IloCplexModeler in a native J2EE clientapplication.This discussion concentrates on IloModeler and IloMPModeler because the classesIloCplex and IloCplexModeler implement these interfaces and thus inherit theirmethods. To create a new modeling object, you must first create the IloModeler which willbe used to create the modeling object. For the discussion here, the model will be an instanceof IloCplex, and it is created like this:IloCplex cplex = new IloCplex();Since class IloCplex implements IloMPModeler (and thus its parent interfaceIloModeler) all methods from IloMPModeler and IloModeler can be used for buildinga model. IloModeler defines the methods to:●●●●create modeling variables of type integer, floating-point, or Boolean;construct simple expressions using modeling variables;create objective functions; andcreate ranged constraints, that is, constraints of the form:lowerbound ≤ expression ≤ upperbound74 <strong>ILOG</strong> <strong>CPLEX</strong> <strong>11.0</strong> — USER’ S MANUAL

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!