8.7.3. MDOEnv

MDOEnv

Represent a MindOpt runtime environment.

Properties

ErrorMsg

Retrieve the latest error message

ErrorMsg

Retrieve the latest error message

Methods

Dispose

Release resources corresponding to the environment

Get

Retrieve the value of an int parameter

Get

Retrieve the value of the double parameter

Get

Retrieve the value of a string parameter

GetParamInfo

Retrieve information about the int parameter by its name

GetParamInfo

Retrieve information about the double parameter by its name

GetParamInfo

Retrieve information about string parameters by its name

MDOEnv

Use the associated log file to construct an environment

MDOEnv

Construct an environment

MDOEnv

Construct an environment

Message

Append a message to environment logs

ReadParams

Read parameter settings from a file

ResetParams

Reset all parameters to their default values

Set

Set a new value for the int parameter

Set

Set a new value for the double parameter

Set

Set a new value for the string parameter

Start

Start the current environment

WriteParams

Write parameter settings to a file

void Dispose()

Release resources corresponding to the environment

int Get(MDO.IntParam param)

Retrieve the value of an int parameter

Parameters

MDO.IntParam param – Parameter

Returns

The current value of the parameter.

double Get(MDO.DoubleParam param)

Retrieve the value of the double parameter

Parameters

MDO.DoubleParam param – Parameter

Returns

The current value of the parameter.

string Get(MDO.StringParam param)

Retrieve the value of a string parameter

Parameters

MDO.StringParam param – Parameter name

Returns

The current value of the parameter

void GetParamInfo(MDO.IntParam param, int[] info)

Retrieve information about the int parameter by its name

Parameters
  • MDO.IntParam param – Parameter name

  • int[] info – The info array contains four entries: the current value of the parameter, the minimum allowable value, the maximum allowable value, and the default value.

void GetParamInfo(MDO.DoubleParam param, double[] info)

Retrieve information about the double parameter by its name

Parameters
  • MDO.DoubleParam param – Parameter name

  • double[] info – The info array contains four entries: the current value of the parameter, the minimum allowable value, the maximum allowable value, and the default value.

void GetParamInfo(MDO.StringParam param, string[] info)

Retrieve information about string parameters by its name

Parameters
  • MDO.StringParam param – Parameter

  • string[] info – The info array contains two entries: the current value of the parameter and the default value.

MDOEnv(string? logFileName)

Use the associated log file to construct an environment

Parameters

string? logFileName – The log file name associated with the environment.

MDOEnv(bool empty)

Construct an environment

Parameters

bool empty – Whether to construct an empty environment

MDOEnv()

Construct an environment

void Message(string message)

Append a message to environment logs

Parameters

string message – The message to be appended.

void ReadParams(string paramfile)

Read parameter settings from a file

Parameters

string paramfile – The file name. Note that the file format and compression type should be encoded as a suffix in the file name. The valid file format is .prm. Supported compression types include .gz and .Bz2.

void ResetParams()

Reset all parameters to their default values

void Set(MDO.IntParam param, int value)

Set a new value for the int parameter

Parameters
  • MDO.IntParam param – Parameter

  • int value – The new value to be set.

void Set(MDO.DoubleParam param, double value)

Set a new value for the double parameter

Parameters
  • MDO.DoubleParam param – Parameter

  • double value – The new value to be set.

void Set(MDO.StringParam param, string value)

Set a new value for the string parameter

Parameters
  • MDO.StringParam param – Parameter

  • string value – The new value to be set.

void Start()

Start the current environment

void WriteParams(string paramFile)

Write parameter settings to a file

Parameters

string paramFile – The name of the file to be written. Note that the file format and compression type should be encoded as a suffix in the file name. The valid file format is .prm. Supported compression types include .gz and .Bz2.