Originally posted by: viva0521
May I ask another question regarding the solution printing? I was trying to output my solution like this:
execute{
var ofile = new IloOplOutputFile("modelRun.txt");
ofile.writeln("Solution:");
for(var <i,j> in HWArcs)for(o in Ori)for( d in Dest)
if(y[<i,j>][o][d] > 0)
writeln("<",i.fromnode,",",i.tonode,",",o,",",d,",","y[<i,j>][o][d],">");
for(var <i,j> in RWArcs)for(o in Ori)for( d in Dest)
if(x[<i,j>][o][d] > 0)
writeln("<",i.fromnode,",",i.tonode,",",o,",",d,",","x[<i,j>][o][d],">");
ofile.writeln("Optimal objective value="+cplex.getObjValue());
}
But it gave the error info: Scripting parser error: missing expression. Also how can i add title for solution x and y,respectively?
Would you kindly provide any idea? Thanks!
regards
#DecisionOptimization#OPLusingCPLEXOptimizer