Decision Optimization

Decision Optimization

Delivers prescriptive analytics capabilities and decision intelligence to improve decision-making.

 View Only
  • 1.  Tuple Index in Java & CPLEX Concert

    Posted Thu June 03, 2021 12:22 PM
    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


  • 2.  RE: Tuple Index in Java & CPLEX Concert

    Posted Thu June 03, 2021 03:12 PM
    This is basically a duplicate of this question.

    ------------------------------
    Paul Rubin
    Professor Emeritus
    Michigan State University
    ------------------------------