8.7.5. MDOConstr¶
- MDOConstr¶
Represent a constraint in MindOpt application.
Properties
Retrieve the index of this constraint
- Index¶
Retrieve the index of this constraint.
Methods
Retrieve a constraint-owned int attribute value by its name
Retrieve a constraint-owned char attribute value by its name
Retrieve a constraint-owned double attribute value by its name
Retrieve a constraint-owned string attribute value by its name
Test if this constraint is the same as another
Set the value of a constraint-owned int attribute
Set the value of a constraint-owned char attribute
Set the value of a constraint-owned double attribute
Set the value of a constraint-owned string attribute
Retrieve the string representation of constraint
- int Get(MDO.IntAttr attr)¶
Retrieve a constraint-owned int attribute value by its name.
- Parameters
MDO.IntAttr attr – The attribute name.
- Returns
The attribute value.
- char Get(MDO.CharAttr attr)¶
Retrieve a constraint-owned char attribute value by its name.
- Parameters
MDO.CharAttr attr – The attribute name.
- Returns
The attribute value.
- double Get(MDO.DoubleAttr attr)¶
Retrieve a constraint-owned double attribute value by its name.
- Parameters
MDO.DoubleAttr attr – The attribute name.
- Returns
The attribute value.
- string Get(MDO.StringAttr attr)¶
Retrieve a constraint-owned string attribute value by its name.
- Parameters
MDO.StringAttr attr – The attribute name.
- Returns
The attribute value.
- bool SameAs(MDOConstr other)¶
Test if this constraint is the same as another.
- Parameters
MDOConstr other – The constraint to be compared.
- Returns
True if these two are the same
- void Set(MDO.IntAttr attr, int value)¶
Set the value of a constraint-owned int attribute.
- Parameters
MDO.IntAttr attr – The attribute name.
int value – The new value to be set.
- void Set(MDO.CharAttr attr, char value)¶
Set the value of a constraint-owned char attribute.
- Parameters
MDO.CharAttr attr – Attribute name
char value – The new value to be set.
- void Set(MDO.DoubleAttr attr, double value)¶
Set the value of a constraint-owned double attribute.
- Parameters
MDO.DoubleAttr attr – The attribute name.
double value – The new value to be set.
- void Set(MDO.StringAttr attr, string value)¶
Set the value of a constraint-owned string attribute.
- Parameters
MDO.StringAttr attr – The attribute name.
string value – The new value to be set.
- string ToString()¶
Retrieve the string representation of constraint.
- Returns
The string representation of constraint.