Originally posted by: TracyLLL
Hi,
I want to write the solution to my model to a .txt or excel file for post processing. I found this printSolution method and the expected output is a .dat file. But I am not sure how it works. I tried in the main block:
thisOplModel.generate();
var ofile=new IloOplOutputFile("output.txt");
var udcDef=thisOplModel.modelDefinition;
var udcCplex=cplex;
var udcDat=thisOplModel.dataElements;
var udc=new IloOplModel(udcDef,udcCplex);
udc.addDataSource(udcDat);
udc.generate();
if(udcCplex.solve()){
udc.printSolution();
ofile.writeln("solution found");
}else{
ofile.writeln("no solution");
}
After running the model, no error or warning msg was shown. The output file showed "solution found", but I could not find a .dat file in my model directory for the solution file. Is it saved in a different path? Where? Or do I need to set a name for the solution .dat file? Can anyone give an example?
Thanks a lot!
#DecisionOptimization#OPLusingCPLEXOptimizer