• 1 reply
  • Latest Post - ‏2013-01-23T20:22:24Z by SystemAdmin
17 Posts

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

‏2012-11-12T23:00:29Z |

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

Updated on 2013-01-23T20:22:24Z at 2013-01-23T20:22:24Z by SystemAdmin
  • SystemAdmin
    1883 Posts

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

    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").