8.9.5. MDOConstr

MDOConstr

Represent a constraint in MindOpt application.

Methods

get

Retrieve a constraint-owned int attribute value by its name

get

Retrieve a constraint-owned char attribute value by its name

get

Retrieve a constraint-owned double attribute value by its name

get

Retrieve a constraint-owned string attribute value by its name

index

Retrieve the index of this constraint

sameAs

Test if this constraint is the same as another

set

Set the value of a constraint-owned int attribute

set

Set the value of a constraint-owned char attribute

set

Set the value of a constraint-owned double attribute

set

Set the value of a constraint-owned string attribute

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.

int index()

Retrieve the index of this constraint.

Returns

The index of this constraint.

boolean 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.