Topic
  • 2 replies
  • Latest Post - ‏2013-07-29T17:13:53Z by zapi
zapi
zapi
2 Posts

Pinned topic multidimensional parameter using ilog opl

‏2013-07-25T18:21:21Z |

I am using ILOG OPL Development studio IDE  6.0.1

I am beginning to work on ILOG CPLEX, I'm programing a optimization model but I have a problem, I can't write a multidimensional parameter. When I try to write the 3D parameter (.dat file) like an array, the software show an error: "Invalid array size, expecting 3". 
I am writing like this:

(.mod file)

int  P[u][z][v]= ...;

 

(.dat file)

z = {"NOR" "SUR" "OES" }; 
u = {"u1" "u2"};
v = {"TAM" "TAB"};

P = [ [ [1 2 3]

           [2 1 3] ]

         [ [1 3 2]

           [4 5 6] ] ];

Can someone of you help me? 

Thanks.

  • AlexFleischer
    AlexFleischer
    1718 Posts
    ACCEPTED ANSWER

    Re: multidimensional parameter using ilog opl

    ‏2013-07-26T06:27:11Z  

    Hi

     

    int  P[u][v][z]= ...;

     

    will work better

     

    regards

  • AlexFleischer
    AlexFleischer
    1718 Posts

    Re: multidimensional parameter using ilog opl

    ‏2013-07-26T06:27:11Z  

    Hi

     

    int  P[u][v][z]= ...;

     

    will work better

     

    regards

  • zapi
    zapi
    2 Posts

    Re: multidimensional parameter using ilog opl

    ‏2013-07-29T17:13:53Z  

    Hi

     

    int  P[u][v][z]= ...;

     

    will work better

     

    regards

    Thank you very much.