Originally posted by: Voigtler
Hello,
I'm working with the Travelling Salesman Example and try to write data to an Excel-Sheet (test.xls).
If i delete the flow-control-script, so that solving runs only once, i can write to the sheet like this.
I want to test it with an integer called nn;
int SheetConnection tabelle(
"test.xls"); nn to SheetWrite(tabelle,
"'Test'!H2:H2");
If i use the flow control script, writing to the sheet is not possible. What do i need to add to the flow control ?
main
{ var opl = thisOplModel var mod = opl.modelDefinition; var dat = opl.dataElements; var status = 0; var it =0;
while (1)
{ var cplex1 =
new IloCplex(); opl =
new IloOplModel(mod,cplex1); opl.addDataSource(dat); opl.generate(); it++; writeln(
"Iteration ",it,
" with ", opl.subtours.size,
" subtours.");
if (!cplex1.solve())
{ writeln(
"ERROR: could not solve"); status = 1; opl.end();
break;
} opl.postProcess(); writeln(
"Current solution : ", cplex1.getObjValue());
if (opl.newSubtourSize == opl.n)
{ opl.end(); cplex1.end();
break;
// not found
} dat.subtours.add(opl.newSubtourSize, opl.newSubtour); dat.nn = 5;
// Testing opl.end(); cplex1.end();
} status;
}
In the end i want to write the x
<i,j> which are used into an excel sheet.
I hope somebody can help me with my problem
#DecisionOptimization#MathematicalProgramming-General