Decision Optimization

Decision Optimization

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

 View Only
  • 1.  Multi-dimensional array from excel

    Posted Mon February 01, 2010 09:13 AM

    Originally posted by: SystemAdmin


    Hi everybody,

    does any one know how to read a 3-d (or even higher) array from a excel spreadsheet to a "float flownbLocnbLocnbLoc=..." ??

    Many thanks in advance
    Shahin
    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 2.  Re: Multi-dimensional array from excel

    Posted Wed February 10, 2010 12:34 PM

    Originally posted by: davidoff


    Well, I do not understand your question . Excel Spreadsheet are in 2D, aren't they ?
    So I would understand your question if you 'd ask "how do I fill up a 3D OPL array from an excel collection of data" ?

    Now, suppose you have a collection of multiple dimensions data in excel , let's take a 3 dimensional array with name,surname, and age
    The best way to store it into OPL is through a set of tuple, each tuple storing one record of your collection.

    then you may transform this tuple set into an array . Look at the transp project in the OPL samples . You will see nice transformations from a tuple set into an array

    float Cost[Routes] = [ <t.p,<t.o,t.d>>:t.cost | t in TableRoutes ];
    


    Hope this helps

    David
    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 3.  Re: Multi-dimensional array from excel

    Posted Wed March 23, 2011 11:12 AM

    Originally posted by: KingCC


    Hi,

    I have data in excel like:

    1 1 1 1
    2 2 2 2
    3 3 3 3
    4 4 4 4
    5 5 5 5
    6 6 6 6

    I want to read it into a 3D matrix

    ahttp://1..2http://1..3http://1..4, and ahttp://1..2[1]http://1..4=[1 1 1 1,2 2 2 2]; ahttp://1..2[2]http://1..4=[3 3 3 3,4 4 4 4];
    ahttp://1..2[3]http://1..4=[5 5 5 5,6 6 6 6];

    How should I do this?

    Thanks.

    King
    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 4.  Re: Multi-dimensional array from excel

    Posted Thu March 24, 2011 01:30 PM

    Originally posted by: SystemAdmin


    Hi,

    see the answer posted in the other thread.

    Best regards,
    --
    Veronique
    #DecisionOptimization
    #OPLusingCPLEXOptimizer