LocalSolver logo
is now
Hexaly logo

We're excited to share that we are moving forward. We're leaving behind the LocalSolver brand and transitioning to our new identity: Hexaly. This represents a leap forward in our mission to enable every organization to make better decisions faster when faced with operational and strategic challenges.


LSSurrogateParameters Class

class localsolver.LSSurrogateParameters

Parameters specific to the surrogate modeling feature. Surrogate parameters can be used to query and set the evaluation budget and the evaluation points of the associated external function.

Since:

9.5

See:

LSExternalContext.EnableSurrogateModeling

Summary

Methods

GetEvaluationLimit

Returns the maximum number of evaluations.

SetEvaluationLimit

Sets the maximum number of evaluations.

CreateEvaluationPoint

Creates an evaluation point for the external function.

GetNbEvaluationPoints

Returns the number of evaluation points.

GetEvaluationPoint

Returns the evaluation point at the given position.

Instance methods

int GetEvaluationLimit()

Returns the maximum number of evaluations. By default, the maximum number of evaluations is set to the largest positive integer on 32 bits, that is 2^32-1 = 2,147,483,647 > 10^9.

Returns:

Maximum number of evaluations.

Return type:

int

void SetEvaluationLimit(int evaluationLimit)

Sets the maximum number of evaluations. By default, the maximum number of evaluations is set to the largest positive integer on 32 bits, that is 2^32-1 = 2,147,483,647 > 10^9. Only allowed in states Modeling or Stopped.

Arguments:

evaluationLimit – Maximum number of evaluations.

LSEvaluationPoint CreateEvaluationPoint()

Creates an evaluation point for the external function. It consists of a list of values corresponding to the function’s arguments and return value. 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. Only allowed in states Modeling or Stopped.

Returns:

Evaluation point.

Return type:

LSEvaluationPoint

int GetNbEvaluationPoints()

Returns the number of evaluation points.

Returns:

Number of evaluation points.

Return type:

int

LSEvaluationPoint GetEvaluationPoint(int pos)

Returns the evaluation point at the given position.

Arguments:

pos – Position of the evaluation point.

Returns:

Evaluation point at the given position.

Return type:

LSEvaluationPoint