Try our new documentation site (beta).
Filter Content By
Version
Text Search
${sidebar_list_label} - Back
Filter by Language
or_()
or_ ( variables )
Used to set a binary decision variable equal to the logical OR of a list of other binary decision variables. You can pass the arguments as a Python list or as a comma-separated list.
Note that the Gurobi Python interface includes an equivalent
any_()
function.
Example usage:
m.addConstr(z == or_(x, y)) m.addConstr(z == or_([x, y]))
Return value:
Returns a GenExpr object.
![](/wp-content/plugins/hd_documentations/content/images/documentation-ampl-guide.webp)
![](/wp-content/plugins/hd_documentations/content/images/documentation-cloud.webp)
![](/wp-content/plugins/hd_documentations/content/images/documentation-example-tour.webp)
![](/wp-content/plugins/hd_documentations/content/images/documentation-quick-start.webp)
![](/wp-content/plugins/hd_documentations/content/images/documentation-reference-manuals.webp)
![](/wp-content/plugins/hd_documentations/content/images/documentation-remote-services.webp)
![](/wp-content/plugins/hd_documentations/content/images/quickstart-os-linux.webp)
![](/wp-content/plugins/hd_documentations/content/images/quickstart-os-mac-osx.webp)
![](/wp-content/plugins/hd_documentations/content/images/quickstart-os-windows.webp)