0 / 0
Multiple model files in a Decision Optimization experiment

Multiple model files in a Decision Optimization experiment views

You can create a Python or OPL models that use multiple model files

For Python or OPL models, in the Build model view, you can add multiple files by clicking the + tab next to MODEL, and selecting Add new empty or Upload Files (to add any type of file). You can also select Add engine settings file so that you can customize the default CPLEX and CP Optimizer settings. These settings are then provided in a Visual editor where you can select different categories and options.

The MODEL tab must always contain your main model. If you try to upload another file with the same name, for example model.py, you are prompted to upload it with new name or replace your main model.

You can also replace a model (current tab only) by clicking the Import icon Import icon. If you choose to replace a model by using the Replace icon replace icon, all tabs are deleted.

See the Multifile example in the Model_Builder folder of the DO-samples.

For Python models, if you generate a notebook that has multiple model files, these files are automatically referenced in the generated notebook so that you can read them from the notebook. The Python version for your generated notebook depends on the environment that you configured for your scenario. If the environment was automatically created for your scenario, the notebook uses the default Python version 3.10.

Learn more

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