8.5.7. MDOGenConstr

MDOGenConstr

Represent a general constraint in MindOpt application.

Methods

get

Retrieve a general-constraint-owned int attribute value by its name

get

Retrieve a general-constraint-owned string attribute value by its name

index

Retrieve the index of this general constraint

sameAs

Test if this general constraint is the same as another

set

Set the value of a general-constraint-owned int attribute

set

Set the value of a general-constraint-owned string attribute

int get(MDO.IntAttr attr)

Retrieve a general-constraint-owned int attribute value by its name.

Parameters

MDO.IntAttr attr – The attribute name.

Returns

The attribute value.

String get(MDO.StringAttr attr)

Retrieve a general-constraint-owned string attribute value by its name.

Parameters

MDO.StringAttr attr – The attribute name.

Returns

The attribute value.

int index()

Retrieve the index of this general constraint.

Returns

The index of this constraint.

bool sameAs(MDOGenConstr c2)

Test if this general constraint is the same as another.

Parameters

MDOGenConstr c2 – The general constraint to be compared.

Returns

True if these two are the same

void set(MDO.IntAttr attr, int value)

Set the value of a general-constraint-owned int attribute.

Parameters
  • MDO.IntAttr attr – The attribute name.

  • int value – The new value to be set.

void set(MDO.StringAttr attr, String value)

Set the value of a general-constraint-owned string attribute.

Parameters
  • MDO.StringAttr attr – The attribute name.

  • String value – The new value to be set.