HxParam Class

class HxParam

Solving parameters. This type contains some methods allowing you to parameterize the resolution of the model. For the sake of simplicity, only a few parameters are actually offered to tune the search.

Summary

Fields

HxParam.nbThreads

Number of threads used to parallelize the search. The number of threads must be a positive integer. The default number of threads is set to 0 which means that the number of threads is automatically adapted to your computer and to your optimization model.

This attribute is read-write but it can only be changed in states MODELING or STOPPED.

Return type:

int

HxParam.verbosity

Verbosity level of the solver. The default verbosity is set to 1. There are 3 defined verbosity levels:

  • 0: All the traces are disabled.

  • 1: Normal verbosity. This is the default level.

  • 2: Detailed verbosity. Displays statistics during the search.

This attribute is read-write but it can only be changed in states MODELING or STOPPED.

Return type:

int (0, 1 or 2)

HxParam.seed

Seed of the pseudo-random number generator used by the solver. The seed must be a positive integer. The default seed is set to 0.

This attribute is read-write but it can only be changed in states MODELING or STOPPED.

Return type:

int (must be positive or zero)

HxParam.timeLimit

Time limit in seconds before the solver stops.

This attribute is read-write but it can only be changed in states MODELING or STOPPED.

Return type:

int (must be positive or zero)

HxParam.iterationLimit

Maximum number of iterations before the solver stops.

This attribute is read-write but it can only be changed in states MODELING or STOPPED.

Return type:

int (must be positive or zero)

HxParam.annealingLevel

Simulated annealing level

Deprecated since version 8.5: The annealing level doesn’t have a significant influence on the search anymore. The tuning of this parameter won’t be allowed in a future version.

The level must be an integer between 0 and 9. The default simulated annealing level is set to 1. Only allowed in

This attribute is read-write but it can only be changed in states MODELING or STOPPED.

Return type:

int (between 0 and 9)

HxParam.timeBetweenDisplays

Time in seconds between two consecutive displays in console while the solver is running. The default time between displays is set to 1 second.

This attribute is read-write but it can only be changed in states MODELING or STOPPED.

Return type:

int (must be strictly positive)

HxParam.timeBetweenTicks

Time in seconds between two events of type TIME_TICKED. The default time between ticks is set to 1 second.

This attribute is read-write but it can only be changed in states MODELING or STOPPED.

Return type:

int (must be strictly positive)

HxParam.iterationBetweenTicks

Number of iterations between two events of type ITERATION_TICKED. The default number of iterations between ticks is set to 10,000.

This attribute is read-write but it can only be changed in states MODELING or STOPPED.

Return type:

int (must be strictly positive)

HxParam.logFile

Path of the Hexaly Optimizer log file. If the path is nil, no log will be saved. To tune the logging verbosity, see verbosity.

Return type:

String or nil

HxParam.objectiveThresholds

Thresholds of the objectives. If an objective is minimized (resp. maximized), then the optimization of this objective is stopped as soon as this lower (resp. upper) threshold is reached. It can be useful for goal programming.

This field returns a readonly map-like structure with the following features:

  • A count field e.g. objectiveThresholds.count(). This count field is always equal to the number of objectives present in the model.

  • An overloaded index [] operator to get a threshold for a specific objective, e.g. objectiveThresholds[0]. The index must be between 0 and objectiveThresholds.count() - 1. Accessing a value outside these bounds throws an exception.

  • An overloaded iterator operator to iterate over the objective thresholds with a for statement.

This attribute is read-write but it can only be read in states PAUSED and STOPPED and write in state STOPPED.