Decision Optimization

Decision Optimization

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


#Analytics
#DecisionOptimization
#DecisionOptimization
 View Only
  • 1.  how can I initialize data for 3D array in Opl ??

    Posted 02/14/14 03:57 PM

    Originally posted by: khadeejah


    Hi everyone,

    How can I initialize data for 3D array in Cplex 12.5.1 OPL  ?? I [x][y][z], if x contains 2 elements , y 3 elements , z 5 elements

    How I write it  in data file and mod file??


    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 2.  Re: how can I initialize data for 3D array in Opl ??

    Posted 02/15/14 08:26 AM

    Originally posted by: davidoff


    range rx = 1..3;
    range ry = 1..2;
    range rz = -4..-1;
    
    int data[rx][ry][rz] = ...;
    

    And in dat file

    data = [[[1 1 1 0]
                     [2 4 3 4]]
                 [[2 0 4 1]
                     [4 0 1 3]]
                 [[1 3 0 4]
                     [3 3 3 4]]];
    

     


    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 3.  Re: how can I initialize data for 3D array in Opl ??

    Posted 02/18/14 03:20 PM

    Originally posted by: khadeejah


    I understand based on the mod file you've put as an example that there's 24 elements for the data 2x3x4,

    but I didn't get why the data is structured this way, and the numbers order in brackets???


    #DecisionOptimization
    #OPLusingCPLEXOptimizer