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.CreateEvaluationPoint See: LSBlackBoxContext.GetEvaluationPoint
Summary¶
AddArgument |
Adds an integer argument with the given value. |
SetArgument |
Sets the value of the argument at the given position. |
SetReturnValue |
Sets the return value of this evaluation point. |
IsIntReturnValue |
Returns true if the black-box function associated with this evaluation point is an integer function, false otherwise. |
IsDoubleReturnValue |
Returns true if the black-box function associated with this evaluation point is a double function, false otherwise. |
IsIntArgument |
Returns true if the argument at this given position is an integer, false otherwise. |
IsDoubleArgument |
Returns true if the argument at this given position is a double, false otherwise. |
GetIntReturnValue |
Returns the return value of this evaluation point. |
GetDoubleReturnValue |
Returns the return value of this evaluation point. |
GetIntArgument |
Returns the value of the argument at the given position. |
GetDoubleArgument |
Returns the value of the argument at the given position. |
Instance methods¶
-
void
AddArgument
(long value)¶ Adds an integer argument with the given value. Only allowed if the associated decision variable is an integer or a boolean. Only allowed in state
Stopped
.Arguments: value – Value of the argument.
-
void
AddArgument
(double value) Adds a double argument with the given value. Only allowed if the associated decision variable is a double. Only allowed in state
Stopped
.Arguments: value – Value of the argument.
-
void
SetArgument
(int pos, long value)¶ Sets the value of the argument at the given position. Only allowed if this argument is an integer or a boolean. Only allowed in state
Stopped
.Arguments: - pos – Position in the argument list.
- value – Value of the argument.
-
void
SetArgument
(int pos, double value) Sets the value of the argument at the given position. Only allowed if this argument is a double. Only allowed in state
Stopped
.Arguments: - pos – Position in the argument list.
- value – Value of the argument.
-
void
SetReturnValue
(long value)¶ Sets the return value of this evaluation point. Only allowed if the black-box function associated with this evaluation point is an integer function. Only allowed in state
Stopped
.Arguments: value – Return value of this point.
-
void
SetReturnValue
(double value) Sets the return value of this evaluation point. Only allowed if the black-box function associated with this evaluation point is a double function. Only allowed in state
Stopped
.Arguments: value – Return value of this point.
-
bool
IsIntReturnValue
()¶ Returns true if the black-box function associated with this evaluation point is an integer function, false otherwise. You can retrieve the value with
LSBlackBoxEvaluationPoint.GetIntReturnValue()
. Only allowed in stateStopped
.Returns: True if the return value is an integer. Return type: bool
-
bool
IsDoubleReturnValue
()¶ Returns true if the black-box function associated with this evaluation point is a double function, false otherwise. You can retrieve the value with
LSBlackBoxEvaluationPoint.GetDoubleReturnValue()
. Only allowed in stateStopped
.Returns: True if the return value is a double. Return type: bool
-
bool
IsIntArgument
(int pos)¶ Returns true if the argument at this given position is an integer, false otherwise. You can retrieve the value with
LSBlackBoxEvaluationPoint.GetIntArgument(int pos)
. Only allowed in stateStopped
.Arguments: pos – Position in the argument list. Returns: True if the argument at this given position is an integer. Return type: bool
-
bool
IsDoubleArgument
(int pos)¶ Returns true if the argument at this given position is a double, false otherwise. You can retrieve the value with
LSBlackBoxEvaluationPoint.GetDoubleArgument(int pos)
. Only allowed in stateStopped
.Arguments: pos – Position in the argument list. Returns: True if the argument at this given position is a double. Return type: bool
-
long
GetIntReturnValue
()¶ Returns the return value of this evaluation point. Only allowed if the black-box function associated with this evaluation point is an integer function. Only allowed in state
Stopped
.Returns: Return value of this point. Return type: long
-
double
GetDoubleReturnValue
()¶ Returns the return value of this evaluation point. Only allowed if the black-box function associated with this evaluation point is a double function. Only allowed in state
Stopped
.Returns: Return value of this point. Return type: double