Decision Optimization

Decision Optimization

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

 View Only
Expand all | Collapse all

4 Dimensional Array Excel

  • 1.  4 Dimensional Array Excel

    Posted Wed May 15, 2013 11:50 AM

    Originally posted by: demius


    Hello Guys,

     

    I have a question regarding the export of an optimal solution to MS Excel.

    I already made a tuple with the four sets:

    tuple someTuple{

      int set1;

     int set2;

     int set3;

    int set4;

    int value;

    }

    {someTuple}someSet = {<p,j,e,t,x[p][j][e][t]>|p in set1, j in set2, e in set 3, t in set 4};

    What is the code for writing this Tuple to MS Excel? 

    Currently I got 

    someSet to SheetWrite(Output, "Sheet2!D4:BW18");

    CPLEX tells me, that the range is not wide enough.

     

    Thanks for your help!


    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 2.  Re: 4 Dimensional Array Excel



  • 3.  Re: 4 Dimensional Array Excel

    Posted Tue May 21, 2013 05:40 AM

    Originally posted by: H.Ruzi


    Hello,

     

    I already I am afraid it does not. My problem is not how to build the tuple, but how to write a tuple back to MS Excel Spreadsheets. 

    If I set up the tuple like stated above, what do I write in the .dat file? 

     

    Best regards


    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 4.  Re: 4 Dimensional Array Excel

    Posted Tue May 21, 2013 05:49 AM

    Hi,

     

    try

     

    someSet to SheetWrite(Output, "Sheet2!A1:E18");

     

    if you have 18 elements

     

    regards


    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 5.  Re: 4 Dimensional Array Excel

    Posted Tue May 21, 2013 08:12 AM

    Originally posted by: H.Ruzi


     

    Hey,

     

    thank you for your help! I tried that before, but I get a fault indication stating that the range size is not wide enough. If I got for example the following values for my sets:

    set1=3

    set2=2

    set3=4

    set4=5

    I need an excel space of 3*2 columns 4*5 rows? At least that is what I am currently doing. do I understand that right?

    regards


    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 6.  Re: 4 Dimensional Array Excel

    Posted Tue May 21, 2013 09:31 AM

    Hi

     

    each tuple has 5 fields :

    int set1;

     int set2;

     int set3;

    int set4;

    int value;

     

    so you need 5 columns * the nb of rows if the number of tuples in your tuple set

     

    regards


    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 7.  Re: 4 Dimensional Array Excel

    Posted Tue May 21, 2013 10:57 AM

    Originally posted by: H.Ruzi


    Thank you very much, that worked!


    #DecisionOptimization
    #OPLusingCPLEXOptimizer