8.7.12. MDOVar

MDOVar

Represent a decision variable in MindOpt application

Properties

Index

Retrieve the index of this variable

Index

Retrieve the index of this variable

Methods

Get

Retrieve the int attribute value owned by a variable by name

Get

Retrieve a char attribute value owned by a variable by name

Get

Retrieve a double attribute value owned by a variable by name

Get

Retrieve a string attribute value owned by a variable by name

SameAs

Test whether this variable is the same as another variable

Set

Set the value of the int attribute owned by a variable

Set

Set the value of the char attribute owned by a variable

Set

Set the value of the double attribute owned by a variable

Set

Set the value of the string attribute owned by a variable

ToString

Convert the current decision variable to a string

int Get(MDO.IntAttr attr)

Retrieve the int attribute value owned by a variable by name

Parameters

MDO.IntAttr attr – Attribute name

Returns

Attribute value

char Get(MDO.CharAttr attr)

Retrieve a char attribute value owned by a variable by name

Parameters

MDO.CharAttr attr – Attribute name

Returns

Attribute value

double Get(MDO.DoubleAttr attr)

Retrieve a double attribute value owned by a variable by name

Parameters

MDO.DoubleAttr attr – Attribute name

Returns

Attribute value

string Get(MDO.StringAttr attr)

Retrieve a string attribute value owned by a variable by name

Parameters

MDO.StringAttr attr – Attribute name

Returns

Attribute value

bool SameAs(MDOVar v2)

Test whether this variable is the same as another variable

Parameters

MDOVar v2 – Variables to compare

Returns

True if the two are the same

void Set(MDO.IntAttr attr, int value)

Set the value of the int attribute owned by a variable.

Parameters
  • MDO.IntAttr attr – Attribute name

  • int value – The new value to be set.

void Set(MDO.CharAttr attr, char value)

Set the value of the char attribute owned by a variable.

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 the double attribute owned by a variable.

Parameters
  • MDO.DoubleAttr attr – Attribute name

  • double value – The new value to be set.

void Set(MDO.StringAttr attr, string value)

Set the value of the string attribute owned by a variable.

Parameters
  • MDO.StringAttr attr – Attribute name

  • string value – The new value to be set.

string ToString()

Convert the current decision variable to a string.

Returns

The string format of the decision variable.