Decision Optimization

Decision Optimization

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


#Analytics
#DecisionOptimization
#DecisionOptimization
 View Only
Expand all | Collapse all

Export a model to .lp file before the problem solved?

  • 1.  Export a model to .lp file before the problem solved?

    Posted 11/12/12 06:00 PM

    Originally posted by: outlookeye


    Hi,

    I'm using IDE OPL 12.4 to solve a problem,but I want to export a .lp file for it without solving the problem, and execute the .lp file with CPLEX directly.
    I followed the instructions provided in this forum :
    --You could set both following parameters to export your model without solving:
    1. turn off the presolve
    --To turn off presolve:
    add a settings file to your run configuration (.ops file)
    open the settings file and under "Mathematical Programming > Preprocessing", set "limit on the number of presolve passes made" to 0
    2. set a time limit of 0

    Also, I add the limits in my .mod file: (I tried to put this limit at the beginning or at the end of my .mod file)
    execute CPX_PARAM {
    cplex.preind = 0; // turns presolve off
    cplex.itLim = 0; // sets Simplex maximum iteration limit to 0
    }

    After configuring these, I run the mod file. It export .lp file, but it also solve the problem and gives me the solution. What's the problem???
    I don't want opl to solve the problem, since it takes too much time. I only need the exported .lp file.

    Thank you for your help

    --
    Pan
    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 2.  Re: Export a model to .lp file before the problem solved?

    Posted 01/23/13 03:22 PM

    Originally posted by: SystemAdmin


    By default, OPL will always try to solve the model.
    So to do what you want, you need to use scripting with a main block (look at the examples). In this main block, just generate the model and call cplex.exportModel("file.lp").
    #DecisionOptimization
    #OPLusingCPLEXOptimizer