StochasticSolver

abstract class StochasticSolver(problemDefinition: ProblemDefinition, evaluator: EvaluatorIfc, maxIterations: Int, replicationsPerEvaluation: ReplicationPerEvaluationIfc, streamNum: Int = 0, val streamProvider: RNStreamProviderIfc = KSLRandom.DefaultRNStreamProvider, name: String? = null) : Solver, RNStreamControlIfc(source)

Represents an abstract base class for stochastic solvers. This class provides foundational functionality for solvers that utilize randomness during their optimization process.

Parameters

problemDefinition

the problem being solved

evaluator

The evaluator responsible for assessing the quality of solutions. Must implement the EvaluatorIfc interface.

maxIterations

The maximum number of iterations allowed for the solving process.

replicationsPerEvaluation

Strategy to determine the number of replications to perform for each evaluation.

streamNum

the random number stream number, defaults to 0, which means the next stream

streamProvider

the provider of random number streams, defaults to KSLRandom.DefaultRNStreamProvider

name

Optional name identifier for this instance of the solver.

Inheritors

Constructors

Link copied to clipboard
constructor(problemDefinition: ProblemDefinition, evaluator: EvaluatorIfc, maxIterations: Int, replicationsPerEvaluation: ReplicationPerEvaluationIfc, streamNum: Int = 0, streamProvider: RNStreamProviderIfc = KSLRandom.DefaultRNStreamProvider, name: String? = null)

Creates a stochastic solver with the specified parameters.

Types

Link copied to clipboard
object Companion
Link copied to clipboard
inner class RandomlyBestStartingPoint(maxRandomStartingPoints: Int = defaultMaxRandomStartingPoints, replicationsPerRandomStartingPoint: Int = defaultReplicationsPerRandomStartingPoint) : StartingPointIfc

Represents a starting point generator that uses a randomly generated feasible point that is based on a sampling of randomly generated points within the feasible region of the problem definition.

Properties

Link copied to clipboard

If true, the stream will automatically participate in having its stream advanced to the next sub-stream via stream managers

Link copied to clipboard
open override var antithetic: Boolean

Tells the stream to start producing antithetic variates

Link copied to clipboard
open override var resetStartStreamOption: Boolean

If true, the stream will automatically participate in having its stream reset to its start stream via stream managers

Link copied to clipboard

rnStream provides a reference to the underlying stream of random numbers

Link copied to clipboard

Can be supplied to provide a method for specifying a feasible starting point. The default is to randomly generate a starting point

Link copied to clipboard
Link copied to clipboard

Functions

Link copied to clipboard
open override fun advanceToNextSubStream()

Positions the RNG at the beginning of its next substream

Link copied to clipboard
open override fun resetStartStream()

The resetStartStream method will position the RNG at the beginning of its stream. This is the same location in the stream as assigned when the RNG was created and initialized.

Link copied to clipboard
open override fun resetStartSubStream()

Resets the position of the RNG at the start of the current substream

Link copied to clipboard

Generates a set of randomly generated points (inputs) for the problem. The points are uniformly sampled from the feasible region and will be unique.

Link copied to clipboard

Generates a set of randomly generated points (inputs) for the problem. The points are sampled using Latin hyper-cube sampling over the ranges of the inputs. The points might not be feasible with respect to linear or functional constraints for the problem.

Link copied to clipboard
fun useLatinHyperCubeStartingPoints(pointsPerDimension: Int)

Sets the starting point generator to use a randomly generated input-feasible points that are based on Latin hyper-cube sampling.

Link copied to clipboard
fun useRandomlyBestStartingPoint(maxRandomStartingPoints: Int = defaultMaxRandomStartingPoints, replicationsPerRandomStartingPoint: Int = defaultReplicationsPerRandomStartingPoint)

Sets the starting point generator to use a randomly generated input-feasible point that is associated with the best solution found from a sampling of randomly generated points within the feasible region of the problem definition. This approach causes the simulation oracles to be run multiple times during the search.