OptimizationConfigurationValidator

Pre-run validator for OptimizationRunConfiguration.

Companion to RunConfigurationValidator. Where the type system already enforces single-field and same-class invariants in the spec data classes (via init blocks on the @Serializable types), this validator focuses exclusively on cross-reference and model-dependent checks that the type system cannot express:

  • decision-variable references in starting points and constraints,

  • response-name references in response constraints,

  • simulated-annealing temperature relationships across nested specs,

  • model-resolution and key-existence checks against a built probe model,

  • control-vs-decision-variable name conflicts on the model.

validate performs document-only checks and never builds a model.

validateForRun runs validate first; if those pass, it builds a short-lived probe model from OptimizationRunConfiguration.model (via RunConfigurationValidator.resolveProbeModel) and runs the model-aware checks. If document-level errors exist, runtime checks are skipped to avoid building models from a configuration that is already known to be invalid and to prevent duplicate errors.

The validator does not call ksl.simopt.problem.ProblemDefinition.validateProblemDefinition. Its own checks cover the same ground (objective response, decision-variable names, response-constraint names) without depending on engine internals; OptimizationSolverFactory invokes the engine validator at solver-build time.

Functions

Link copied to clipboard

Validates fields that can be checked from the spec alone.

Link copied to clipboard

Validates fields that require runtime context in addition to document checks. If document-level errors exist, runtime checks are skipped.