OptimizationSolverFactory

Builds a runnable Solver from an OptimizationRunConfiguration.

OptimizationSolverFactory is the runtime translation layer from the persisted, app-layer optimization spec to live engine objects. It:

  1. constructs a ProblemDefinition from OptimizationRunConfiguration.problem, including penalty-function defaults and per-constraint overrides;

  2. wraps OptimizationRunConfiguration.model in a ConfiguredModelBuilder that applies the template's controls and RV overrides at evaluator-build time;

  3. creates a SolutionCacheIfc and (optional) SimulationRunCacheIfc from OptimizationRunConfiguration.evaluation;

  4. dispatches on the SolverSpec sealed variant to the matching Solver companion-object factory method (with random-restart wrapping when SolverSpec.randomRestart is non-null);

  5. applies the cross-cutting EvaluationSpec settings on the returned solver instance.

Validation should be performed by ksl.app.validation.OptimizationConfigurationValidator before calling build; this factory throws IllegalArgumentException / IllegalStateException from the underlying engine APIs if the configuration is internally inconsistent (e.g. unknown decision-variable names against the model). The engine itself runs ProblemDefinition.validateProblemDefinition at evaluator-construction time, so this factory does not duplicate that check.

Constructors

Link copied to clipboard
constructor(provider: ModelProviderIfc? = null)

Types

Link copied to clipboard
object Companion

Functions

Link copied to clipboard

Build a runnable Solver from config. See class KDoc for the translation pipeline.