LSBlackBoxEvaluationPoint Class¶
-
class
localsolver.LSBlackBoxEvaluationPoint¶ An evaluation point associated with a black-box function.
Evaluation points are used to specify known points for a function in advance. It can be useful to warm-start the solver when the function is particularly expensive to evaluate, or if you already have a good estimate of the optimal point.
Note: This information is used by the solver to drive the solution process. You must be careful about the data you provide: if an incorrect value is given, the solver may have an unexpected behavior.
Since: 10.0 See: LSBlackBoxContext.create_evaluation_point()See: LSBlackBoxContext.get_evaluation_point()
Summary¶
add_argument |
Adds an argument with the given value. |
set_argument |
Sets the value of the argument at the given position. |
set_return_value |
Sets the return value of this evaluation point. |
get_return_value |
Returns the return value of this evaluation point. |
get_argument |
Returns the value of the argument at the given position. |
Instance methods¶
-
LSBlackBoxEvaluationPoint.add_argument(value)¶ Adds an argument with the given value. Only allowed in state
STOPPED.Parameters: value ( intordouble) – Value of the argument.
-
LSBlackBoxEvaluationPoint.set_argument(pos, value)¶ Sets the value of the argument at the given position. Only allowed in state
STOPPED.Parameters: - pos – Position in the argument list.
- value (
intordouble) – Value of the argument.
-
LSBlackBoxEvaluationPoint.set_return_value(value)¶ Sets the return value of this evaluation point. The type of the parameter value must be the same as the type of the black-box function associated with this evaluation point :
intfor integer black-box function,doublefor double black-box function,- an iterable (
list,set,tuple) composed of numbers of same type (intordouble) for array black-box function.
Only allowed in state
STOPPED.Parameters: value ( int,doubleor an iterable) – Return value of this point.
-
LSBlackBoxEvaluationPoint.get_return_value()¶ Returns the return value of this evaluation point. The returned value can be a double, an integer or
LSArraydepending on the type of the black-box function associated with this evaluation point. Only allowed in stateSTOPPED.Returns: Return value of this point. Return type: int,doubleorLSArray
-
LSBlackBoxEvaluationPoint.get_argument(pos)¶ Returns the value of the argument at the given position. The returned value can be a double or an integer depending on the type of the argument value. Only allowed in state
STOPPED.Parameters: pos – Position in the argument list. Returns: Value of the argument. Return type: intordouble