Decision Optimization

Decision Optimization

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

 View Only
  • 1.  Cplex Excel Data Import Trouble

    Posted Mon July 23, 2012 03:37 PM

    Originally posted by: SystemAdmin


    To Whom it May Concern,

    I am new to Cplex and would like to take advantage of the excel spreadsheet data import feature. I have entered the commands I found on the tutorial, but still get errors.

    I may be incorrect in trying to take a normal .dat structure and use the from syntax to pull from my spreadsheet. It seemed intuitive to me.

    Specifically, the error I'm getting is that OPL claims it cannot find the excel file. I should also note that I have excel installed on my computer and use it quite frequently. I believe I have an xlsx file, but have tried this in both xlsx and xls form to no avail.

    I have pasted my code below. Thanks in advance.

    Model:

    {string} Products = ...;
    {string} Constraints = ...;
    float ConsMatrix ProductsConstraints = ...;
    float ProfitProducts = ...;
    float SupplyConstraints = ...;
    dvar float+ ProductionProducts;

    maximize
    sum(p in Products)
    Profit[p] * Production[p];
    subject to{
    forall( c in Constraints)
    ct:
    sum(p in Products)
    ConsMatrix[p][c] * Production[p] <= Supply[c];
    }

    Data:

    SheetConnection sheet("OPLTrial.xls");
    Products = {"newspapers" "magazines"};
    Constraints = {"money" "time" "bolts"};
    ConsMatrix from SheetRead(sheet,"Sheet1!A1:B3");
    Profit from SheetRead(sheet,"Sheet1!E2:E4");
    Supply from SheetRead(sheet,"Sheet1!H2:H3");
    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 2.  Re: Cplex Excel Data Import Trouble

    Posted Mon July 30, 2012 07:50 AM

    Originally posted by: SystemAdmin


    What is the platform you are using?
    OPL now only supports Excel 32bits, even on win64 pltaforms. Perhaps it is the problem?
    #DecisionOptimization
    #OPLusingCPLEXOptimizer