Cookie Settings

Try our new documentation site (beta).

Filter Content By
Version
Table of contents
Filter by Language
C API Details
C++ API Details
GRBModel +
Java API Details
GRBModel +
.NET API Details
GRBModel +
Python API Details
Model +
Attributes
Parameters
Parameter Descriptions +


GRBVar

Gurobi variable object. Variables are always associated with a particular model. You create a variable object by adding a variable to a model (using GRBModel.addVar), rather than by using a GRBVar constructor.

The methods on variable objects are used to get and set variable attributes. For example, solution information can be queried by calling get(GRB.DoubleAttr.X). Note, however, that it is generally more efficient to query attributes for a set of variables at once. This is done using the attribute query method on the GRBModel object (GRBModel.get).



Subsections