Decision Optimization

 View Only
  • 1.  Write a variable with 3 dimensions to Excel

    Posted Wed March 13, 2013 05:17 AM

    Originally posted by: SystemAdmin


    Hi,

    I would like to know how I can write the outcome of a three dimensional decision variable to excel.

    It is about the variable x(shift)(day)(week).
    • there are four shifts;
    • seven days;
    • four weeks;

    The document I have to write it to is: SheetConnection excelbestand2("E:\\Sabena\\SabenaTechnicsresult.xls")

    I was also wondering if it is possible for a four dimensional decision variable?
    Then it would be: x(shift)(day)(week)(cycle)
    • there are four shifts;
    • seven days;
    • four weeks;
    • two cycles;

    Many thanks in advance for the feedback,

    Greetings,

    Aurelie
    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 2.  Re: Write a variable with 3 dimensions to Excel

    Posted Wed March 13, 2013 01:33 PM
    Hi,

    what you can do is to write your n dimensions array into a tuple set. n records will be the dimensions of your array and the n+1 th record will be the value.
    I hope this helps

    regards
    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 3.  Re: Write a variable with 3 dimensions to Excel

    Posted Thu March 21, 2013 09:30 AM

    Originally posted by: SystemAdmin


    Thanks for your answer.

    I tried the following:

    tuple someTuple{
    int shift;
    int dag;
    int week;
    int cycle;
    int value;
    }
    {someTuple} someSet = {<i,d,w,c, x[i][d][w][c]> | i in shift, d in dag, w in week, c in cycle};

    But then I get the warning: "Decision variable (or expression) "x" not allowed".
    Can it have to do something with the fact that "x" is a boolean?

    Many thanks in advance for your feedback!
    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 4.  Re: Write a variable with 3 dimensions to Excel

    Posted Thu March 21, 2013 09:45 AM
    Hi,

    are you sure you wrote this after the subject to block ?

    regards
    #DecisionOptimization
    #OPLusingCPLEXOptimizer