File: Model.rst

package info (click to toggle)
optlang 1.8.3-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 26,784 kB
  • sloc: python: 12,459; makefile: 129
file content (11 lines) | stat: -rw-r--r-- 690 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
Model
=====

The model object represents an optimization problem and contains the variables, constraints an objective that make up the problem. Variables and constraints can be added and removed using the :code:`.add` and :code:`.remove` methods, while the objective can be changed by setting the objective attribute, e.g. :code:`model.objective = Objective(expr, direction="max")`.

Once the problem has been formulated the optimization can be performed by calling the :code:`.optimize` method. This will return the status of the optimization, most commonly 'optimal', 'infeasible' or 'unbounded'.

.. autoclass:: optlang.interface.Model
  :members:
  :undoc-members:
  :show-inheritance: