Originally posted by: SystemAdmin
I think the method ReadProjectSettings is what I want in this case.
I wrote the following code:
IloOplFactory.setDebugMode(true);
IloOplFactory oplF = new IloOplFactory();
IloOplErrorHandler errHandler = oplF.createOplErrorHandler(System.out);
IloOplProject prj = oplF.createOplProject(".\\MILP.mod");
String modpath= ".\\MILP.mod";
String datpath= ".\\input.dat";
IloCplex cplex = oplF.createCplex();
IloCplex.ParameterSet paraset = cplex.getParameterSet();
IloOplSettings settings = oplF.createOplSettings(errHandler);
settings.setWithNames(true);
FileInputStream ifs = new FileInputStream(".\\MIPconfig.ops");
IloOplRunConfiguration rc = oplF.createOplRunConfiguration(modpath,datpath);
prj.ReadProjectSettings(ifs,"OPSFILE",cplex,paraset,settings);
ifs.close();
IloOplModel opl=rc.getOplModel();
opl.generate();
cplex.exportModel(".\\test.lp");
cplex.end();
oplF.end();
I tried to run and got the error saying that there exists mismatches of types between the arguments I gave and that it requires.
Again many thanks.
#DecisionOptimization#OPLusingCPLEXOptimizer