Is there a way to let oplrun
take a specific CPLEX parameter, such as CPX_PARAM_LPMETHOD (Linear Programming method). In the reference here, it is called by various names for different languages:
C Name: CPX_PARAM_LPMETHOD
C++ Name: RootAlg
Java Name: RootAlg
.NET Name: RootAlg
InteractiveOptimizer: lpmethod
But there is no reference about the OPL or oplrun.
Is it possible to change this parameter in an oplrun
session? Or do I have to use these other languages/interfaces?
It's not possible to do this (directly) using oplrun command line options. You can, however, use oplrun to execute a specific run configuration that has an associated settings file (a .ops file). For example:
When you use the IDE to set individual parameters, the OPL names for the parameters are stored in the .ops file. For example, the CPLEX parameter
CPX_PARAM_TILIMIT
is namedtiLimit
in OPL (see here for more).Alternately, you could export your OPL model using the
-e
oplrun option. Then, you could run that using the CPLEX interactive and use a parameter file or set them in the command line itself (see here for the syntax).Lastly, you can surely use one of the programming language APIs available in CPLEX to accomplish the same thing. This would provide the most control, but may take more time (depending on how comfortable you are with programming).
if you just have a specific parameter you would like to change, in the .mod file you can have something like:
In the same .mod file you can also use
And then you have some default value in your .dat file.
To change that parameter from run to run when using oplrun, you can call it with the following command line arguments:
in the .mod you may write
and then you will see in the log
regards