Changing a CPLEX parameter value

Explains how to change a mathematical programming option in the IDE.

Changing CPLEX parameters is useful to experiment with different values. The convenient way is to create a settings file and a different run configuration for each value, or set of values, you want to test. However, if you decide eventually that a particular setting is always needed for the model concerned, you can even set the parameter within the model by writing an execute IBM ILOG Script block. For an example, see Changing CPLEX parameters in the Language User’s Manual.

In the scalableWarehouse example, if you increase the relative MIP gap tolerance to 0.05 (5%), the first solution found is immediately considered to be the final solution because it is at most 3.3333% from the optimal solution (as displayed in the notification message).

To set a CPLEX parameter in the IDE:

  1. Right-click on Scalable data and select New > Settings to create a settings file with an .ops extension. Name the file warehouse.ops.

    This is explained in Adding a settings file in Getting Started with the IDE.

  2. Add the new warehouse.ops settings file to the run configuration Scalable data, using drag and drop.
  3. Click Mixed Integer Programming > Tolerances in the option tree on the left.
  4. Enter the value 0.05 for Relative MIP gap tolerance and press Enter.
    Figure 1. Changing the value of a CPLEX parameter
    Changing CPLEX parameters in settings file.

    You can also create a specific run configuration as explained in Creating and executing a different configuration in Getting Started with the IDE.

  5. Click the Run button Run button to rerun the same configuration (Scalable data). If you are prompted to save, click OK.

    Execution ends almost immediately and the progress chart reflects this fact.

    Note:

    The Run button re-executes the last executed configuration.

    Figure 2. MP models: Progress Chart, New MIP gap tolerance (scalableWarehouse.mod)
    Statistics window for scalableWarehouse model

There are fewer solutions in the Solutions tab and in the Problem Browser list than when the gap tolerance was not user-defined.

You can now close the warehouse example.