Originally posted by: MSaqib
Hi everyone
I have written a main script in my OPL model file. It's purpose is to invoke the model with different data values over an over in a loop. Furthermore, I'm trying to do some fine tuning based on the results of the optimization. My model defines a variable:
dvar
boolean bootup[AVAIL_LOCATIONS][PUREINTERVALS];
that is, a two dimensional decision variable array. After the solver has found a solution, I am trying to write the value of this array to a file.
if (cplex.solve())
{
for(var q = 1 ; q <= rb1.interval_size ; q++)
{ var filename =
"planned" + o +
"." + i +
"." + q +
".dat"; var planfile =
new IloOplOutputFile(filename); planfile.write(
"INIT_WORKLOAD=[");
for(var p = 1 ; p <= rb1.availLocations ; p++) planfile.write(rb1.x[p][q] +
" " ); planfile.write(
"];"); planfile.close();
}
for(k = 1 ; k <= o ; k++)
{ f1.write(
"INIT_BOOTUP=[");
for (dabba = 1 ; dabba <= rb1.availLocations ; dabba++)
{ f1.write(rb1.bootup[dabba][k]); f1.write(
" ");
} f1.writeln(
"];");
} f1.close();
}
What I get in the file is a line like this:
INIT_BOOTUP=[[a IloNumVar] [a IloNumVar] [a IloNumVar] [a IloNumVar] [a IloNumVar] [a IloNumVar] [a IloNumVar] [a IloNumVar] [a IloNumVar] [a IloNumVar] [a IloNumVar] [a IloNumVar] [a IloNumVar] [a IloNumVar] [a IloNumVar] [a IloNumVar] [a IloNumVar] [a IloNumVar] [a IloNumVar] [a IloNumVar] [a IloNumVar] [a IloNumVar] [a IloNumVar] [a IloNumVar] [a IloNumVar] [a IloNumVar] [a IloNumVar] [a IloNumVar] [a IloNumVar] [a IloNumVar] [a IloNumVar] [a IloNumVar] [a IloNumVar] ];
What does
[a IloNumVar]
mean? I have tried a number of things but to no avail. Done web searches as well as looked through the documentation but didn't find anything. I'm attaching the model file with this post.
Thanks in advance for the help.
Best regards
Saqib
#DecisionOptimization#OPLusingCPLEXOptimizer