Originally posted by: IrvL
I have a CP model and am calling it from Java, and using IloCP.next() to loop through solutions. As I get each solution, I call IloOplModel.postProcess() to do some computations on the solution and execute an OPL execute() block that does output. I would like to put that output into a file, that is different each time next() and postProcess() are executed.
I took the sample oplrunsample.java, and added these lines around opl.postProcess() for a CPLEX model to see if I could capture the output:
FileOutputStream fout = new FileOutputStream(new File("irv.out"));
IloOplFactory.getOplFactoryFrom(opl).setOut(fout);
opl.postProcess();
fout.close();
I get a "contact IBM" message:
### UNEXPECTED UNKNOWN ERROR ...
java.lang.RuntimeException: internal error (Please notify IBM)
at ilog.opl.opl_lang_wrapJNI.IloOplModel_postProcess(Native Method)
at ilog.opl.IloOplModel.postProcess(IloOplModel.java:656)
at oplrunsample.OplRunSample.run(OplRunSample.java:131)
at oplrunsample.OplRunSample.main(OplRunSample.java:32)
Is there an issue with IloOplFactory.setOut() from Java?
This is CPLEX Optimization Studio 12.6.1 on Windows x64.
-Irv
#DecisionOptimization#OPLusingCPOptimizer