I am trying to define a binary decision variable in java using cplex. That's a two dimensional variable. It means that if a path starts from a specific station it should be 1 or otherwise 0. I have a set of station, J and a set of paths, K and my decision variable is Z_jk. Currently I am defining the code like following, but it doesn't work. Could anybody please help me?
Thanks in advance.
// define variables
z = new IloNumVar[stations_start.size()][];
for (int j=0; j<stations_start.size();j++) {
z[j] = cplex.numVarArray(paths.size(),0,1);
for (int k=0;k<paths.size();k++) {
z[j][k] = cplex.numVar(new_column, 0, 1,"z");
z[j][k].setName("z."+j+"."+k);
}
}