cplex java variable access from other class
I'm using cplex in Java and I want to access the value of a variable from
another class (after solving).
The variable is initialized in my main program class like this:
IloNumVar[][][] p15 = new IloIntVar[I][J][Q];
After solving the problem, I tried to access the value of p15 as follows:
for(int q=0; q< data.distance1.length-1; q++){
for(int ii=0; ii<data.distance1.length; ii++){
for(int j=0; j<data.distance1.length; j++){
if(cplex.getValue(p15[i][j][q]) >= 1) System.out.println("p15");
}
}
}
Unfortunatly the error message: "p15 cannot be resolved to a variable"
occurs. Is that because the variable is initialized in another class?
What would be the most elegant way to solve the problem?
No comments:
Post a Comment