Decision Optimization

Decision Optimization

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


#Analytics
#DecisionOptimization
#DecisionOptimization
 View Only
  • 1.  data set

    Posted 11/30/08 03:24 PM

    Originally posted by: SystemAdmin


    [glitter said:]

    Hi,

    I am trying to connect OPL with Microsoft Access,
    I have sets :
    {int} Books=...;
    {int} Library=...;
    {int} BM[library]=...;

    The last set gives the books in that library.
    How can i connect the last data set with the Access?It gives an error that says databases donot support data sets of type {int}[{int}].

    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 2.  Re: data set

    Posted 12/01/08 02:37 PM

    Originally posted by: SystemAdmin


    [alain.chabrier said:]

    May be you should share the corresponding part of your .dat file too. That would help.

    Alain
    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 3.  Re: data set

    Posted 12/01/08 02:48 PM

    Originally posted by: SystemAdmin


    [glitter said:]

    DBConnection db("access","db1.mdb");
    /* Reading the sets that will be used in the optimization */

    Books from DBread(db, "SELECT DISTINCT Book_Name FROM BLTable");
    Library from DBread(db, "SELECT DISTINCT Library_Name FROM BLTable");
    BM[library] from DBread(db, "SELECT Book_Name , Library_Name  FROM BLTable");
    when i write like this, the error: databases donot support data sets of type {int}[{int}] shows.

    I also tried the following code,

    for(var k in Library){
    BM[k] from DBread(db, "SELECT Book_Name  WHERE Library_Name =k FROM Model");
                          }   

    but again it gives lots of errors.

    thanx
    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 4.  Re: data set

    Posted 12/11/08 11:29 PM

    Originally posted by: SystemAdmin


    [dgravot@noos.fr said:]

    Looking at the oil project and the "Better database reading" configuration, you can see that something like

    Library,BM from DBRead(db,"select Library_name,Book_name")

    would be closer to what you expect, but once again, you would probably face the fact that "databases donot support data sets of type {int}[{int}]"

    You could nevertheless use a workaround with tuples :

    tuple BookLibrary
    {
    int book;
    int library;
    }
    {BookLibrary} bls = ...;
    {int} BM[l in library]= {<b,l> | <b,l> in bls};


    and the tuple collection would be read from the DB :

    bls from DBread(db, "SELECT Book_Name , Library_Name  FROM BLTable");


    Anyway, I would be curious to see if a simple query could match that also
    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 5.  Re: data set

    Posted 12/28/08 10:59 PM

    Originally posted by: SystemAdmin


    [glitter said:]

    thanx:)
    #DecisionOptimization
    #OPLusingCPLEXOptimizer