0 / 0
Building a model in a Decision Optimization experiment

Building a model in a Decision Optimization experiment

To build a Decision Optimization model in an experiment, click Build model in the sidebar.

You can create or import a model in the following ways:

  • Modeling Assistant - an assisted mode to formulate models in natural language
  • Python (DOcplex code) - a native Python API for Decision Optimization
  • OPL (Optimization Programming Language) - a mathematical programming modeling language for Decision Optimization
  • LP (CPLEX) - an algebraic format for the CPLEX solver (software used to solve Decision Optimization models)
  • CPO (Constraint Programming Optimizer) code - a format for constraint programming models for the CP Optimizer solver
  • Import model for existing notebooks or files including .py, .mod, .mps, .lp, and .cpo files

When you open the Build model view for the first time, you must select one of these modes in the Model wizard.

If you start creating a model in one mode, and then want to start again with another mode, click the Replace Replace icon icon to return to the Model wizard. If you replace your model, the previous one is deleted.

If you select a code method, you can enter your model formulation in the text editor.

Build model view showing Python diet model

This model is taken from the Diet sample. Using the data, the model analyzes the requirements of a healthy diet and the resources available and prescribes the best quantities of different food types.

When you edit your model formulation in the Build model view your content is saved automatically, and the Last saved time is displayed.

When you have finished editing your model, you can solve it by clicking the Run button.

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