> Tutorials > Concert Technology Tutorial for Java Users > The Anatomy of an ILOG Concert Technology Application |
The Anatomy of an ILOG Concert Technology Application |
INDEX
![]() |
To use the ILOG CPLEX Java interfaces, you need to import the appropriate packages into your application. This is done with the lines:
import ilog.concert.*; import ilog.cplex.*; |
As for every Java application, an ILOG CPLEX application is implemented as a method of a class. In this discussion, the method will be the static main
method. The first task is to create an IloCplex
object. It is used to create all the modeling objects needed to represent the model. For example, an integer variable with bounds 0 and 10 is created by calling cplex.intVar(0, 10)
, where cplex
is the IloCplex
object.
Since Java error handling in ILOG CPLEX uses exceptions, you should include the ILOG Concert Technology part of an application in a try
/catch
statement. All the exceptions thrown by any ILOG Concert Technology method are derived from IloException
. Thus IloException
should be caught in the catch
statement.
In summary, here is the structure of a Java application that calls ILOG CPLEX:
Copyright © 1987-2003 ILOG, S.A. All rights reserved. Legal terms. | PREVIOUS NEXT |