Decision Optimization

Decision Optimization

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


#Analytics
#DecisionOptimization
#DecisionOptimization
 View Only
  • 1.  Decision variables with different range

    Posted 01/27/14 12:41 PM

    Originally posted by: Nazanin Esmaili


    Hi,

    I want to define a decision variable which has 4 index but one on these indexes has different range for example:

    int w=6;
    int h=20;
    int p=7;

    dvar boolean x[0..w-1][0..h-1][1][1..3];

    dvar boolean x[0..w-1][0..h-1][2][1..2];

    dvar boolean x[0..w-1][0..h-1][3][1];

    when I defined x such the above, the system gave me an error for the second line that I have already defined x. I appreciate any help. Thanks.

    Nazanin

     


    #CPLEXOptimizers
    #DecisionOptimization


  • 2.  Re: Decision variables with different range

    Posted 01/29/14 04:27 AM

    Please ask this question on the OPL Forum.


    #CPLEXOptimizers
    #DecisionOptimization


  • 3.  Re: Decision variables with different range

    Posted 01/29/14 05:54 AM

    Hi,

    you could either declare 3 arrays x1,x2 and x3

    or have a array indexed by tuples with 4 components:

    tuple t

    {

    int c1;

    int c2;

    int c3;

    int c4;

    }

     

    then you define {t} s= ... ;

     

    and finally dvar boolean x[s];

     

    regards


    #CPLEXOptimizers
    #DecisionOptimization