8.6.7. MDOSOS¶
- MDOSOS¶
MindOpt applications can represent SOS (Special Ordered Set) constraints. These constraints are used to model specific types of discrete optimization problems.
Methods
Retrieve the int attribute value owned by the SOS constraint by name
Retrieve the index of this SOS constraint in the model
Check whether this SOS constraint is the same as another SOS constraint
Set the value of the int attribute owned by the SOS constraint
- int get(MDO.IntAttr attr)¶
Retrieve the int attribute value owned by the SOS constraint by name.
- Parameters
MDO.IntAttr attr – Attribute name.
- Returns
Property value.
- int index()¶
Retrieve the index of this SOS constraint in the model
- Returns
The index of this SOS constraint.
- boolean sameAs(MDOSOS other)¶
Check whether this SOS constraint is the same as another SOS constraint.
- Parameters
MDOSOS other – Compared SOS constraints.
- Returns
Return True if the two constraints are the same.
- void set(MDO.IntAttr attr, int newval)¶
Set the value of the int attribute owned by the SOS constraint.
- Parameters
MDO.IntAttr attr – Attribute name.
int newval – The new value to be set.