0 / 0
Configuring engine settings in a Decision Optimization experiment

Configuring engine settings in the Build model view

You can add engine settings files with Python or OPL models in your Decision Optimization experiment. A settings file is where you store user-defined values options for mathematical programming, or constraint programming. It gives you access to the solver (engine) parameters so that you can modify them.

Click + (plus sign) and select Add engine settings file in the Build model view. The Visual editor opens where you can see the default parameter values, which are arranged in different categories, that you can customize for your model. You can also search for specific parameters by entering a name in the Find settings search field.

In this window, you can select different parameters or edit fields. If you modify the default parameters, a Customized Settings pane that lists your changes appears.

Engine settings .ops file shown open in Visual Editor view with one customized parameter

You can toggle the Visual editor switch to the off position to view your changes in an XML editor. The file, when displayed in the XML editor, only contains the parameters that you changed, and does not list all the default parameters. You can also edit the parameters in this XML editor and your changes will be displayed in the Visual editor when you toggle the switch back to the on position.

XML editor showing modifications made to default engine setting parameters

Python models

When you add an engine settings file, you must then specify it explicitly in your Python model. If you add several engine settings files with your model, you must specify which file is to be loaded to solve the model. For example, to specify a file called MyEngineSettings.ops, use the following code in your Python model:
from docplex.mp.model_reader import ModelReader
    prm = ModelReader.read_ops_file(filename="MyEngineSettings.ops")
    
For more information, see DOcplex documentation.

See also the PythonEngineSettings sample located in the Model_Builder folder of the DO-samples. Select the relevant product and version subfolder.

OPL models

You can import an .ops file to use for your engine settings, but you can only have one engine settings file for your model. Importing such a file can be useful if you have some non-default parameters that you have specified in IBM ILOG CPLEX Optimization Studio that you want to import into your experiment.

For more information about the OPL language and engine parameters, see:
Generative AI search and answer
These answers are generated by a large language model in watsonx.ai based on content from the product documentation. Learn more