SolverSpec

@Serializable
sealed class SolverSpec(source)

Serializable selection of a simulation-optimization solver and its algorithm-specific parameters.

Each sealed variant captures the constructor parameters that are plain data; non-serializable arguments to the live solver constructors (evaluator, stream provider, problem definition, equality checkers, functional sampler/elite-size hooks) are supplied by OptimizationSolverFactory and are not part of the persisted document.

Sealed-class polymorphic serialization is used: the JSON/TOML output carries a "type" discriminator with values "stochasticHillClimbing", "simulatedAnnealing", "crossEntropy", or "rSpline".

Random-restart is not a separate sealed variant. Any algorithm can be wrapped by setting randomRestart on its variant; setting it to null (the default) disables the wrapper. This keeps the sealed hierarchy focused on algorithm choice and lets every algorithm be wrapped uniformly.

Inheritors

Constructors

Link copied to clipboard
protected constructor()

Types

Link copied to clipboard
@Serializable
@SerialName(value = "crossEntropy")
data class CrossEntropy(val startingPoint: Map<String, Double>? = null, val maxIterations: Int, val randomRestart: RandomRestartSpec? = null, val streamNum: Int = 0, val name: String? = null, val replicationsPerEvaluation: Int, val sampler: CESamplerSpec = CESamplerSpec.Normal(), val elitePct: Double? = null, val ceSampleSize: Int? = null) : SolverSpec
Link copied to clipboard
@Serializable
@SerialName(value = "rSpline")
data class RSpline(val startingPoint: Map<String, Double>? = null, val maxIterations: Int, val randomRestart: RandomRestartSpec? = null, val streamNum: Int = 0, val name: String? = null, val initialNumReps: Int, val sampleSizeGrowthRate: Double, val maxNumReplications: Int) : SolverSpec
Link copied to clipboard
@Serializable
@SerialName(value = "simulatedAnnealing")
data class SimulatedAnnealing(val startingPoint: Map<String, Double>? = null, val maxIterations: Int, val randomRestart: RandomRestartSpec? = null, val streamNum: Int = 0, val name: String? = null, val replicationsPerEvaluation: Int, val temperature: TemperatureSpec = TemperatureSpec.AutoCalibrate(), val coolingSchedule: CoolingScheduleSpec, val stoppingTemperature: Double) : SolverSpec
Link copied to clipboard
@Serializable
@SerialName(value = "stochasticHillClimbing")
data class StochasticHillClimbing(val startingPoint: Map<String, Double>? = null, val maxIterations: Int, val randomRestart: RandomRestartSpec? = null, val streamNum: Int = 0, val name: String? = null, val replicationsPerEvaluation: Int) : SolverSpec

Stochastic Hill Climbing. Mirrors ksl.simopt.solvers.algorithms.StochasticHillClimber.

Properties

Link copied to clipboard
abstract val maxIterations: Int

Maximum number of main-loop iterations the solver is permitted to run; must be positive when validated.

Link copied to clipboard
abstract val name: String?

Optional human-readable solver instance name.

Link copied to clipboard

Optional random-restart wrapper. When non-null the solver factory wraps the chosen algorithm in a ksl.simopt.solvers.algorithms.RandomRestartSolver.

Link copied to clipboard
abstract val startingPoint: Map<String, Double>?

Optional starting point for the search, keyed by decision-variable name. When null, the solver chooses its own starting point.

Link copied to clipboard
abstract val streamNum: Int

Random-number stream number used to seed the solver's stochastic decisions. 0 means "next available stream".