One possible use of the eplex library is to use ECLiPSe just as a modelling language and let the external solver do all the solving. For that purpose, a high-level interface is provided. It is implemented on top of the eplex eplex instance, and is a single optimization primitive to invoke the external solver, without requiring the user to explicitly declare an eplex instance, set up a solver state and then invoking the solver.
After setting up the constraints by posting them to the eplex instance, the external solver's MIP optimizer can be invoked as a black box using
Here is a simple linear program. As long as the optimizer is not invoked, the constraints just delay:
[eclipse 2]: eplex:(X+Y >= 3), eplex:(X-Y =:= 0).
X = X
Y = Y
Delayed goals:
eplex : (X - Y =:= 0), eplex : (X + Y >= 3)
yes.
Now a call to
optimize/2 is added
in order to trigger the solver:
[eclipse 3]: eplex:(X+Y >= 3), eplex:(X-Y =:= 0), optimize(min(X), C). Y = 1.5 X = 1.5 C = 1.5 yes.(Note that X and Y have not been explicitly declared. They default to reals ranging from -infinity to +infinity.)
By declaring one variable as integer, we obtain a Mixed Integer Problem:
[eclipse 4]: integers([X]), eplex:(X+Y >= 3), eplex:(X-Y =:= 0), optimize(min(X), C). Y = 2.0 X = 2 C = 2.0 yes.