Decision Optimization

Decision Optimization

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


#Analytics
#DecisionOptimization
#DecisionOptimization
 View Only
  • 1.  Acessing the different length vector data

    Posted 03/10/16 01:44 PM

    Originally posted by: sandeepsinghchauhan


    I have Three cities: N,D,M
    
    Five Players: A,B,C,D,E
    
    set of Number of matches with respect to each player::
    
    A can play three matches {1,2,3}
    
    B can play five matches {1,2,3,4,5}
    
    C can play eight matches{1,2,3,4,5,6,7,8}
    
    D can play four matches{1,2,3,4}
    
    E can play six matches{1,2,3,4,5,6}
    
    
    Now my problem is how to assign
    
    [N][A][3 matches]
    
    [N][B][5matches]
    
    [N][C][8matches]
    
    [N][D][4matches]
    
    [N][E][6matches]
    
    [D][A][3 matches]
    

    [D] [B][5 matches]

    ....

    .... so on

    How can i access the above in generic way  please help


    #CPLEXOptimizers
    #DecisionOptimization


  • 2.  Re: Acessing the different length vector data

    Posted 03/10/16 05:37 PM

    Originally posted by: Stanko_86


    Hi,

    have you tried with tuple instead of using arrays:

    tuple DataInfo
    {
        {string} city;
        {string} player;
        int match;
    };
    {DataInfo} pData = {<"N", "A", 1>,<"N","A",2>,<"N","A"3> ...}
    

     


    #CPLEXOptimizers
    #DecisionOptimization


  • 3.  Re: Acessing the different length vector data

    Posted 03/11/16 12:07 AM

    Originally posted by: sandeepsinghchauhan


    Thanks for your reply but i can't use tuples because my data is very huge around 2000 combinations of this city, player and match


    #CPLEXOptimizers
    #DecisionOptimization


  • 4.  Re: Acessing the different length vector data

    Posted 03/11/16 03:37 AM

    Originally posted by: Stanko_86


    Here is recommendation how to fill in tuple:

    {string} Cities = {"City1" ,"City2", "City3"};
    
    {string} Players = {"Player_1", "Player_2", "Player_3", "Player_4", "Player_5"};
    
    int nMatches[Players] = [ 3, 5, 8,4, 6];
    
    tuple _DataInfo_
    {
        string city;
        string player;
        int nMatch;
    }  
    
    {_DataInfo_} dataInfo = {<city, player, n> | city in Cities, player in Players, n in 1..nMatches[player]};
    

    An example opl\examples\opl\transp explains the advance of tuple in relation to matrix approach.

     


    #CPLEXOptimizers
    #DecisionOptimization


  • 5.  Re: Acessing the different length vector data

    Posted 03/11/16 04:23 AM

    Originally posted by: sandeepsinghchauhan


    Thanks for your reply

    Cities are in range and players are also in range

    Cities = 1..5;

    Players = 1..100;

    Matches  is a vector  [ 3, 5, 8,4, 6];


    #CPLEXOptimizers
    #DecisionOptimization


  • 6.  Re: Acessing the different length vector data

    Posted 03/11/16 04:37 AM

    Originally posted by: sandeepsinghchauhan


    int A = 20;

    int B = 60;

    range L = 1..A;

    range S = 1..B;

    int C[L][S] = [3,5,4,8,6,12,45,65,7,5];

    tuple _DataInfo_ {

      int A;
      int B;
      int C;
    }
    {_DataInfo_}dataInfo = {<m,n,s>| m in  1..A,n in 1..B,s in 1..C[L][S]};

     

    L and S are range

     


    #CPLEXOptimizers
    #DecisionOptimization