Decision Optimization

Decision Optimization

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


#Analytics
#DecisionOptimization
#DecisionOptimization
 View Only
  • 1.  how to define this dynamic dvar array ? (index is dynamic)

    Posted 07/28/11 03:10 AM

    Originally posted by: qtbgo


    Hi, I want to define an integer dvar array like a[i][j], where i in 1..10 and j in 1..2i.
    Here j depends on i.

    How to define this a[i][j] in opl?

    thanks very much.
    sorry for my english and hopr you understand me.
    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 2.  Re: how to define this dynamic dvar array ? (index is dynamic)

    Posted 09/19/11 10:13 AM

    Originally posted by: SystemAdmin


    execute
    {
    for(i in 1..10)
    for(j in 1..2*i)
    a[i][j] = i*j;
    }
    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 3.  Re: how to define this dynamic dvar array ? (index is dynamic)

    Posted 09/19/11 12:28 PM
    Hi

    it is not possible to have a variable size decision variable array.
    But it is possible to use tuples to do that.
    Let me give you an example.

    tuple t
    {
     int x;
     int y; 
    }  
     
    {t} s={<i,j> | i in 1..10,j in 1..2*10: j<=2*i};
     
    dvar int a[s];
    


    Alex
    #DecisionOptimization
    #OPLusingCPLEXOptimizer