Output

Explains the output of the oplrun command.

The output of oplrun shows a mixture of the information displayed in the various tabs of the IDE Output window (see The Output tabs in Getting Started with the IDE) followed by information on the final solution. The output is different if you execute a model or a run configuration and also depends on the options you specify.

Note:
  1. oplrun does not display intermediate feasible solutions.

  2. Because of the specific features of the solving engines, the solution of a model may change from one platform to another. For the same reason, if you do not reach the absolute objective, you may get different objectives.

oplrun return values

In this case, "output" refers both to output on the screen and the return values for the process:

  • 0 = OK

    • execution ended with no errors

  • 1 = solve failed

    • no solution found

  • 2 = OPL processing failed, for example:

    • tuning

    • generate

    • postprocessing

  • 3 = more general failure, for example:

    • writing files

    • creating OPL run time

    • cd ..\..

Executing a model

For example, if you enter at the command prompt:

C:\Program Files\IBM\ILOG\CPLEX_Studio<version>\opl\bin\x64_win64>oplrun "C:\Program Files\IBM\ILOG\CPLEX_Studio<version>\opl\examples\opl\nurses\nurses.mod" "C:\Program Files\IBM\ILOG\CPLEX_Studio<version>\opl\examples\opl\nurses\nurses.dat"

you get output similar to that shown below. The data file parameter is mandatory if the data is external.

Figure 1. Executing a model from the command line (nurses.mod)
oplrun on the nurses project with no option

Executing a project

For example, if you enter at the command prompt:

C:\Program Files\IBM\ILOG\CPLEX_Studio<version>\opl\bin\x64_win64>oplrun -p "C:\Program Files\IBM\ILOG\CPLEX_Studio<version>\opl\examples\opl\vellino" "Bin generation"

the run configuration Bin generation of the vellino project is executed and the output displayed is similar to that shown below.

Figure 2. Executing a project from the command line (vellino example)
Output of oplrun when passing a run configuration

Execution options

The output information displayed also depends on the execution option you have specified. For example, compare Figure 1 above with Figure 3 below, and Figure 4.

The syntax with the —relax option is:

C:\Program Files\IBM\ILOG\CPLEX_Studio<version>\opl\bin\x64_win64>oplrun -relax "C:\Program Files\IBM\ILOG\CPLEX_StudioStudio<version>\opl\examples\opl\nurses\nurses.mod" "C:\Program Files\IBM\ILOG\CPLEX_Studio<version>\opl\examples\opl\nurses\nurses.dat"
Figure 3. Output of the oplrun command with the –relax option
oplrun with the –relax option

The syntax with the —conflict option is:

C:\Program Files\IBM\ILOG\CPLEX_Studio<version>\opl\bin\x64_win64>oplrun -conflict "C:\Program Files\IBM\ILOG\CPLEX_Studio<version>\opl\examples\opl\nurses\nurses.mod" "C:\Program Files\IBM\ILOG\CPLEX_Studio<version>\opl\examples\opl\nurses\nurses.dat"
Figure 4. Output of the oplrun command with the –conflict option
oplrun with the –conflict option