Hello,
I am currently migrating the optimization model from CPLEX OPL to CPLEX Concert with Java.
I would like to know how to define decision variable using tuple definition.
In CPLE OPL, I defined the decision variable as below.
tuple Index{ int studentID; int offeringID;}{Index} X= {<s, o> | s in Students, o in offerings}In order to define the decision variable X in Java & CPLEX Concert, I defined class structure and decision variable as below.
class INDEX{ int studneID; int offeringID;}List<INDEX> indexes = new ArrayList<INDEX>();IloNumVar[] X = cplex.numVarArray(indexes.size(), 0, 1, IloNumVarType.Int);I would like to have the constraint such as
cplex.addEg(cplex.sum(X[indexes]), 1), but it didn't work.
Would you please help me how to describe the decision variables with tuple in Java & Cplex?
Thank you for all your help!
------------------------------
Sung Hwang
------------------------------
#DecisionOptimization