Decision Optimization

Decision Optimization

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

 View Only
  • 1.  array related index

    Posted Mon August 01, 2011 12:01 AM

    Originally posted by: zy6631


    I got a problem when using OPL, please help me.
    how to define and access multidimensional array whose indexs are related,for example

    range Jobs = 0..10;
    range Oprs = 1..3;

    int nbMchshttp://1..3 = 2, 3, 4;

    range Mchsj in Oprs = 0..nbMchsj in Oprs;
    dvar boolean xi in Jobsj in Oprs[k in Mchsj] ;

    the third index k's range is a element in array Mchs[], I want its index Mchs[j] is equal to the second index j. how can i do it?
    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 2.  Re: array related index

    Posted Tue August 02, 2011 05:14 AM

    Originally posted by: MSaqib


    One way would be to take the max of nbMchs and define a 3-D array with a fixed third dimension. Then, you could add some constraints to ensure that x[1][1][3] and x[1][1][4] don't get assigned or are not included in the solution.
    #DecisionOptimization
    #OPLusingCPLEXOptimizer