Originally posted by: Paul_Diaz
Hi,
I'm working on a project where I need to access decision variable values. They are represented as dvar int+ work[A][B][C], where A, B and C are range types.
At the moment, I've written the following code that presents some errors.
if (cplex.solve()) {
IloIntMap var = opl.getElement("works").asIntMap();
IloIntRange s1 = opl.getElement("A").asIntRange();
IloIntRange s2 = opl.getElement("B").asIntRange();
IloIntRange s3 = opl.getElement("C").asIntRange();
for (int i = 1; i <= s1.getSize(); i++ ) {
IloIntMap sub = var.getSub(i);
for (int j = 1; j <= s2.getSize(); j++) {
sub = var.getSub(j);
for (int k = 1; k <= s3.getSize(); k++) {
int bl = sub.get(k);
System.out.println(bl);
}
}
}
}
The code presents errors. Can anyone help me with this final part?
Thanks.
Paul.
#DecisionOptimization#OPLusingCPLEXOptimizer