Decision Optimization

Decision Optimization

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

 View Only
Expand all | Collapse all

can decision variable initialized using tuples

  • 1.  can decision variable initialized using tuples

    Posted Thu April 10, 2014 10:43 AM

    Originally posted by: Rajasekhar Kadambur


    Hi,

    How to initialize decision variable using tuple? use of tuple is due to unstructured array in 1 dimensionality and decision variable is four dimensions.

    Consider this example'

    data file:

    // A = [ <{3,2,2}>, <{2,4,3}>,<{2,2}>, <{2,4,3}>, <{1}>, <{3,3,3}>, <{2,4,4}>, <{2,2,2}>, <{4,3,4}> ];

    Mod file:

    int A_var = [[3,3,2],[3,1,3],[3,3,3] ];   // size of unstructured array

    tuple 3D{ int a; int b; {int} c; }

    {3D} Data = {<a,b,c>| a in 1..3, b in 1..3, c in A_var[a][b]};

    dvar boolean X[d in Data][1..60];

    I guess X declared is 4 dimension and i am not able to build constraints based on dvar X....

    for example, X[1][1][1][1] != X[2][1][1][1] != X[3][1][1][1];

    any one should be active not all the three but all three can be 0

    similarly,       X[1][1][1][1] != X[1][2][1][1] != X[1][3][1][1];

                           X[1][1][1][1] != X[1][1][2][1] != X[1][1][3][1];

    sum across first three dimensions should be <= 1;

    Thanks in advance, your advice/ response is highly appreciated

    PS: this constrains are not valid but to have a overview i included that.

     

     

     

     


    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 2.  Re: can decision variable initialized using tuples

    Posted Fri April 11, 2014 04:23 AM

    Hi,

    let me give you an example:

     tuple D3D{ int a; int b; int c; }
     
     

    {D3D} Data = {<a,b,c>| a in 1..3, b in 1..3, c in 1..3};

    dvar int X[Data][1..60];

    subject to
    {
    X[<1,2,3>,5]==2;
    }

     

    regards


    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 3.  Re: can decision variable initialized using tuples

    Posted Fri April 11, 2014 05:03 AM

    Originally posted by: Rajasekhar Kadambur


    here c is unstructured array there the complete problem raise.

    the typical example for size of c dimension is

    A = [ <{3,2,2}>, <{2,4,3}>,<{2,2}>, <{2,4,3}>, <{1}>, <{}>, <{2,4,4}>, <{2,2,2}>, <{4,3}> ];

    for a=1,b=1 => size of c = 3

    a=1,b=2 => size of c = 3

    a=1,b=3 =>size of  c = 2

    a=2,b=1 => size of c = 3

    a=2,b=2 => size of c = 1

    a=2,b=3 => size of c = 0

    a=3,b=1 => size of c = 3

    a=3,b=2 => size of c = 3

    a=3,b=3 => size of c = 2

     

    My problem is how to sum fourth dimension to the values given in A for 27 combinations and among 60 none should be repeated for each "a =1" dimensiion1. and none is repeated for a==2 ||y for a==3;

    4dimension element can be maximum allotted for 3 times only once for each a,b and c

     

     


    #DecisionOptimization
    #OPLusingCPLEXOptimizer