-->

IloEnv is not working

2019-09-21 09:14发布

问题:

I am using Java to solve a series of problems with Cplex. My main goad is to optimise different stances of a model with modified variables and constraints ( and no, I can't modify the main model every time). To do so, I want to use IloEnv, but, this command:

IloEnv env;

is not recognised by Cplex. It gives me the "IloEnv cannot be resolved to a type" error.

Any idea?

回答1:

IloEnv is only available in the C++ API, but not the Java API (where the memory management details are hidden).

With the Java API, you can just create an IloCplex for each instance of your model.

It would be well worth your time to look at the examples that are shipped with CPLEX Optimization Studio. If COSDIR is the location where you installed the product, then the examples can be found at COSDIR/cplex/examples/src/java.