RandomRestartSolver

class RandomRestartSolver(val restartingSolver: Solver, maxNumRestarts: Int = defaultMaxRestarts, streamNum: Int = 0, streamProvider: RNStreamProviderIfc = KSLRandom.DefaultRNStreamProvider, name: String? = null) : StochasticSolver(source)

A class that implements the Random Restart optimization algorithm. This algorithm repeatedly runs the solver with a different starting point until it finds a solution.

Parameters

restartingSolver

The solver to be used for the randomized restarts.

maxNumRestarts

The maximum number of restarts to be performed.

streamNum

The random number stream number to be used for this solver.

streamProvider

The random number stream provider to be used for this solver.

name

Optional name identifier for this instance of the solver.

Constructors

Link copied to clipboard
constructor(restartingSolver: Solver, maxNumRestarts: Int = defaultMaxRestarts, streamNum: Int = 0, streamProvider: RNStreamProviderIfc = KSLRandom.DefaultRNStreamProvider, name: String? = null)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard

Indicates whether the evaluator cache should be cleared between runs. Defaults to true. If the evaluator does not support caching, this value is ignored.

Link copied to clipboard

Functions

Link copied to clipboard
protected open override fun mainIteration()

This function should contain the logic that iteratively executes until the maximum number of iterations is reached or until the stopping criteria is met. The base implementation calls nextPoint() to determine the next point to evaluate, requests an evaluation of the point, and then updates the current solution if the resulting solution is better than the current solution. Generally, implementing startingPoint() and nextPoint() should be adequate. The property iterationCounter represents the current iteration within the mainIteration() function. That is, the value of iterationCounter is incremented prior to the execution of the mainIteration() function.

Link copied to clipboard
open override fun toString(): String