SolverTrackingSpec

@Serializable
data class SolverTrackingSpec(val enableCsvTrace: Boolean = false, val csvFileName: String? = null, val enableConsoleTrace: Boolean = false, val experimentLabel: String = "Run1")(source)

Optional CSV / console trace settings for a simulation-optimization run.

Drives the attachment of one of the autonomous trackers in ksl.simopt.solvers.trackers at submit time:

  • When enableCsvTrace is true, the host attaches a ksl.simopt.solvers.trackers.CsvSolverStateTracker for a plain solver, or a ksl.simopt.solvers.trackers.NestedCsvSolverStateTracker when the built solver is wrapped by ksl.simopt.solvers.algorithms.RandomRestartSolver. The single-vs-nested choice is made at attachment time based on the live ksl.simopt.solvers.Solver instance and is not persisted in this spec.

  • When enableConsoleTrace is true, the host additionally attaches a ksl.simopt.solvers.trackers.ConsoleSolverStateTracker.

experimentLabel is propagated to the tracker's experimentName field (which becomes the ksl.simopt.solvers.trackers.TrackingContext.experimentName value stamped on every emitted row); users can vary it between runs to semantically group tracker output.

csvFileName is the file stem only (no extension, no path). The host resolves it under <workspace>/output/<analysisName>/optimization/ at submit time. When null, the host substitutes a default derived from the solver's name (e.g. <solverName>_trace).

Domain invariants are enforced in init so a malformed spec cannot be constructed:

  • experimentLabel must be non-blank.

  • csvFileName must be non-blank when non-null.

Constructors

Link copied to clipboard
constructor(enableCsvTrace: Boolean = false, csvFileName: String? = null, enableConsoleTrace: Boolean = false, experimentLabel: String = "Run1")

Properties

Link copied to clipboard

file stem under <workspace>/output/<analysisName>/optimization/; null lets the host pick a default

Link copied to clipboard

when true, additionally attach a console tracker that mirrors each iteration snapshot to standard output

Link copied to clipboard

when true, attach a CSV tracker for the duration of the run

Link copied to clipboard

value written into the tracker's experimentName field; tags every emitted row so multiple runs can be distinguished in one combined trace file

Functions

Link copied to clipboard
fun SolverTrackingSpec.attachTo(solver: Solver, optimizationDir: Path, defaultFileName: () -> String): SolverTrackerHandles

Attach every tracker requested by this SolverTrackingSpec to solver.