1

I am working on my thesis statement and i want to automaticly create .lp file of my model by using Cplex OPL's user interface (Windows). I do not know how it should be and quite willing to know the answer. Also, if it is possible, My model takes parameters from an excel file. So, does this .lp file includes parameters or should i do some extra work? I am planning to solve it on Amazon's servers by ubuntu. And, I am open for other suggestions.

Thank you...

purkai
  • 13
  • 3

1 Answers1

2

An LP file can be exported from OPL in two different ways:

  1. You can use the oplrun command line tool and option -e to export the file (see here). This will create a file with the specified name.
  2. In the IDE, you can attach (or modify) a settings file to your run configuration. In that settings file set the export format option to LP. This will create an LP file the name of which is derived from the run configuration name.

In either case, the file will be exported right before the solving starts and a regular solve will ensue. So if you only want to export, you will have to interrupt the solve or set a parameter to stop the solve quickly. For the command line tool oplrun you can use options like -Xbench to avoid solving (see oplrun -X for details).

Parameters are not written to an LP file, so you will have to create parameter settings in a different way. If you plan to solve models on the cloud then it is probably a good idea to create a parameter file with the respective settings.

Note that in general it is better to use the SAV format rather than the LP format, at least if you want to solve with CPLEX. SAV is a binary format. It is an exact representation of the problem. It also is the most compact representation. For LP columns may be reordered, numbers may be truncated, etc. All this may result in slight but unexpected performance differences.

Finally, since you asked for potential alternatives: IBM has a cloud service as well that directly supports solving OPL models from the IDE. Maybe this is an option for you? You can find details about this in the user manual here.

Daniel Junglas
  • 5,830
  • 1
  • 5
  • 22