public class GRBGenConstr extends Object
GRBModel.addGenConstrXxx() methods), rather than by using a
GRBGenConstr constructor.
The methods on general constraint objects are used to get and set
constraint attributes. For example, general constraint types can be
queried by calling get(GRB.IntAttr.GenConstrType). Note, however, that it is
generally more efficient to query attributes for a set of constraints
at once. This is done using the attribute query method on the GRBModel object (GRBModel.get).
| Modifier and Type | Method and Description |
|---|---|
protected void |
finalize() |
double |
get(GRB.DoubleAttr attr)
Query the value of a double-valued attribute.
|
int |
get(GRB.IntAttr attr)
Query the value of an int-valued attribute.
|
String |
get(GRB.StringAttr attr)
Query the value of a string-valued attribute.
|
void |
set(GRB.DoubleAttr attr,
double newval)
Set the value of a double-valued attribute.
|
void |
set(GRB.IntAttr attr,
int newval)
Set the value of an int-valued attribute.
|
void |
set(GRB.StringAttr attr,
String newval)
Set the value of a string-valued attribute.
|
public int get(GRB.IntAttr attr) throws GRBException
attr - The attribute being queried.GRBExceptionpublic double get(GRB.DoubleAttr attr) throws GRBException
attr - The attribute being queried.GRBExceptionpublic String get(GRB.StringAttr attr) throws GRBException
attr - The attribute being queried.GRBExceptionpublic void set(GRB.IntAttr attr, int newval) throws GRBException
attr - The attribute being modified.newval - The desired new value of the attribute.GRBExceptionpublic void set(GRB.DoubleAttr attr, double newval) throws GRBException
attr - The attribute being modified.newval - The desired new value of the attribute.GRBExceptionpublic void set(GRB.StringAttr attr, String newval) throws GRBException
attr - The attribute being modified.newval - The desired new value of the attribute.GRBExceptionCopyright © 2025 Gurobi Optimization, LLC. All rights reserved.