Decision Optimization

Decision Optimization

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

 View Only
  • 1.  SheetWrite

    Posted Thu January 08, 2009 06:15 AM

    Originally posted by: SystemAdmin


    [iikoryoko said:]

    Hello~
    I got a problem about "SheetWrite".....
    My objective function in ILOG is 3dimensions and can I array the result to Excel sheet.

    btw, is any problem about ↓

    SheetConnection Sheet1("OrderData.xls");
    u to SheetWrite(Sheet1,"D16:J35");
    delivery to SheetWrite(Sheet1,"D39:J58");
    b to SheetWrite(Sheet1,"D65:J66");
    qt to SheetWrite(Sheet1,"D62:J63");


    Thanks!!!
    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 2.  Re: SheetWrite

    Posted Tue January 13, 2009 07:27 PM

    Originally posted by: SystemAdmin


    [jfk said:]

    hello there,
    are you sure that your objective is 3D? the objective is supposed to be 1 value. I assume you have a 3D array of decision (dvar) variables and this is what you want to write to excel as result. If this assumption is correct then you have to decide how you want to cut your 3D variable array into 2D's and write the the 2D pieces to excel.

    there are several ways to write to excel (referring to cells or referring to defined names in the workbook).
    take a look at
    ILOG OPL Development Studio 6.1.1 > OPL IDE > IDE Tutorials > Working with external data > The oil sheet example
    if you have doubt on the syntax.

    I hope it helps
    cheers

    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 3.  Re: SheetWrite

    Posted Mon January 19, 2009 01:02 PM

    Originally posted by: SystemAdmin


    [Didier Vidal said:]

    Iikoryoko,

    When I want to write an arbitrary dimension array into a database, I translate it before into a tupleset. Tuplesets are easier to export to a database.
    See example of code below:



    dvar float myValues[1..10][1..50][1..20];

    maximize...
    subject to {
    ...
    }

    // Here start the posprocessing code

    tuple resultTuple {
      key int i;
      key int j;
      key int k;
      float value;
    };

    // The tupleset is created as follows
    {resultTuple} myResult = {<i, j, k, myValues&#91;i&#93;&#91;j&#93;&#91;k&#93;> | i in 1..10, j in 1..50, k in 1..20};

    // Sometimes, you may want to filter the output, for instance not exporting null values. You can do this as follow
    {resultTuple} myFilteredResult = {<i, j, k, myValues&#91;i&#93;&#91;j&#93;&#91;k&#93;> | i in 1..10, j in 1..50, k in 1..20 : abs(<myValues&#91;i&#93;&#91;j&#93;&#91;k&#93;) > myEpsilon};



    Hope this helps,

    Didier.
    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 4.  Re: SheetWrite

    Posted Fri June 05, 2015 01:59 AM

    Originally posted by: OPLnewbie


    Hey. I see it's an older post, but that is exactly what I am looking for. Can anybody explain me what the signs &#91 etc. mean in that formulation? 

     

    // The tupleset is created as follows
    {resultTuple} myResult = {<i, j, k, myValues&#91;i&#93;&#91;j&#93;&#91;k&#93;> | i in 1..10, j in 1..50, k in 1..20};

    Regards


    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 5.  Re: SheetWrite

    Posted Fri June 05, 2015 04:16 AM

    Hi

    simply

    // The tupleset is created as follows
        {resultTuple} myResult = {<i, j, k, myValues[i][j][k] | i in 1..10, j in 1..50, k in 1..20};

    that got fuzzy after some developerworks community changes.

    regards


    #DecisionOptimization
    #OPLusingCPLEXOptimizer