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. When set to 0, the system will create at least 4 threads by default, as it is recommended to have at least 4 physical cores for nominal performance.
This attribute is read-write but it can only be changed in states
MODELINGorSTOPPED.- Return type:
int
- HxParam.nbDisplayedObjectives¶
Maximum number of objectives to display.
This attribute is read-write but it can only be changed in states
MODELINGorSTOPPED.- Return type:
int
- HxParam.nbDisplayedViolatedConstraints¶
Maximum number of violated constraints to display.
This attribute is read-write but it can only be changed in states
MODELINGorSTOPPED.- Return type:
int
- HxParam.warningLevel¶
Warning level of the solver. The warning computation behavior depends on this parameter. There are 3 different levels:
0: Disable warning computation.
1: Automatic behavior (default) - warnings related to the solver configuration are displayed by default. Modeling warnings are not computed.
2: Compute all warnings, including modeling warnings.
Modeling warnings are raised when a constraint or objective cannot be proven to be well defined. If such a warning appears, it indicates a modeling issue in the formulation. In cases where this kind of warning should not appear, it may be because Hexaly does not have sufficient tools to prove it.
For more information about modeling warnings, please refer to the warning section of Debugging a Model.
This attribute is read-write but it can only be changed in states
MODELINGorSTOPPED.- Return type:
int (0, 1 or 2)
- 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
MODELINGorSTOPPED.- 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
MODELINGorSTOPPED.- 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
MODELINGorSTOPPED.- 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
MODELINGorSTOPPED.- Return type:
int (must be positive or zero)
- HxParam.gapLimit¶
Optimality gap used as a termination criterion. When the solver detects that the current gap is below this limit, the current solution is considered optimal.
This attribute is read-write but it can only be changed in states
MODELINGorSTOPPED.- Return type:
double (must be positive or zero)
- 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
MODELINGorSTOPPED.- 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
MODELINGorSTOPPED.- 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
MODELINGorSTOPPED.- 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 between0andobjectiveThresholds.count() - 1. Accessing a value outside these bounds throws an exception.An overloaded
iteratoroperator to iterate over the objective thresholds with aforstatement.
This attribute is read-write but it can only be read in states
PAUSEDandSTOPPEDand write in stateSTOPPED.