Originally posted by: mikeab
Hey Guys,
I have this tuple in my OPL code before main block:
tuple Solution_Pool{
key int sol_num;
int sol_obj;
int sol_y[DOT_F_S];
}
Then I have the following main block:
if(cplex.populate()){
var nsolns = cplex.solnPoolNsolns;
writeln("Number of Solutions = ", nsolns);
var z = new Array();
for(var s = 0 ; s < nsolns ; s++){
writeln(" --------- ");
writeln("sol = ", s, " objective= ", cplex.getObjValue(s));
writeln("Iteration Solution= ", thisOplModel.Sol);
thisOplModel.setPoolSolution(s);
z[s] = thisOplModel.y ;
writeln("z[s]= ", z[s], " ", "s = ", s);
thisOplModel.Sol.add(s, cplex.getObjValue(s), z[s]);
}
However I end up with an error like this when I run my main block:
Description Resource Path Location Type
Scripting runtime error: Tuple component type not supported., " [0 0 0 0 0 1 0 0 0 0 0 0 1 0 0 0 0 0 1 0]"
Can you guys help me understanding whats going on here ?
The variable in my main block aka thisOplModel.y is boolean decision variable in the MIP. I'm trying to store the damn thisOplModel.y in the int tuple array. Is this ok ? How can I resolve this issue ?
Thanks
Mike
#DecisionOptimization#OPLusingCPLEXOptimizer