Decision Optimization

Decision Optimization

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


#Analytics
#DecisionOptimization
#DecisionOptimization
 View Only
  • 1.  How to Run Multiple Data Sets Through Same Model?

    Posted 06/03/10 11:10 AM

    Originally posted by: char507


    Hi,

    I am currently having a problem trying to run multiple data sets through the same model. I am trying to save some memory by not creating the model all over again just to run a new data set.

    My model is very similar to the CustomDataSource example provided with OPL/CPLEX. After I run my model with the first data set and extract the results, I simply want to change the data set for the model and run it again. However, it seems that once I run opl.Generate() the data source cannot be changed.

    What am I doing wrong here? Is there an easier way to accomplish this task?

    Thanks,
    • Charlie

    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 2.  Re: How to Run Multiple Data Sets Through Same Model?

    Posted 06/07/10 06:18 AM

    Originally posted by: SystemAdmin


    Dear Charlie,

    do are doing nothing wrong. That is excatly the way to process OPL/CPLEX. With the opl.generate() you set up the matrix for the LP/MIP-solver, including the coefficients in the objective, constraints, etc. This information is derived from the input data. With a new input data set this process has to be repeated.

    For some smaller changes, like changing some coeeficients in the objective, changing
    bounds of variables (or alike), is is possible to write directly into the matrix of CPLEX. But I would not recommend to do so....

    Hope this helps

    Regards
    Norbert
    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 3.  Re: How to Run Multiple Data Sets Through Same Model?

    Posted 06/23/10 09:41 AM

    Originally posted by: char507


    @trebron

    For now I think i'm simply going to create new models from a "base" run configuration as shown in one of the examples.

    Thanks for the advice!
    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 4.  Re: How to Run Multiple Data Sets Through Same Model?

    Posted 06/07/10 05:20 PM

    Originally posted by: UDOPS


    Can you be specific? How are you sending data to the model? I use a database and run a batch of problems all at once.
    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 5.  Re: How to Run Multiple Data Sets Through Same Model?

    Posted 06/08/10 02:17 AM

    Originally posted by: SystemAdmin


    You will find examples in your distribution: cutstock, mulprod.
    Tschau, Frank
    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 6.  Re: How to Run Multiple Data Sets Through Same Model?

    Posted 06/23/10 09:38 AM

    Originally posted by: char507


    I am currently sending data into the model by creating a custom data source and populating each element using an OplDataHandler just like the CustomDataSource example...
    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 7.  Re: How to Run Multiple Data Sets Through Same Model?

    Posted 06/23/10 01:56 PM

    Originally posted by: ghosh.d7


    I have the same problem, where I have a scheduling problem and I want to run multiple data sets through a model.

    Currently I've expressed the problem using a MOD, OPS, and data file in OPLIDE. I'm not familiar with using batch files to run CPLEX. I've tried running problems using the CMD but it doesn't work for me as it says that "no problem exists". Is there any way to run multiple data sets through a model that is expressed in the standard way in OPLIDE? Or will I have to reformat my code in order to be able to run in CMD?

    I'm not sure if the error I'm getting (no problem exists) is because my problem is MIP. I tried using all ten options that CPLEX suggests to solve the problem including 'mipopt' and others but it didn't solve.

    Thanks
    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 8.  Re: How to Run Multiple Data Sets Through Same Model?

    Posted 06/23/10 02:03 PM

    Originally posted by: ghosh.d7


    Also, I did reformat my code in a way so that I can use another optimizer, glpsol.exe (freeware), to solve the problem. Basically, I have a C++ program that generates a textfile called LP.txt, which then is solved in CMD using glpsol.exe. This way, I can run the textfile generator C++ file from another C++ file that has all the sets of data, and then run all the sets and generate all the LP.txt's and solve them all in the CMD. But I'm sure that's not the most efficient way to do this, and I also want to be able to use CPLEX, not GLP.

    I'm using the following line to solve in the CMD.

    glpsol.exe LP.txt --cpxlp --simplex -o LP-res.txt

    Any help would be greatly appreciated. Thanks
    #DecisionOptimization
    #OPLusingCPLEXOptimizer