CsvSolverStateTracker

class CsvSolverStateTracker(solver: Solver, outputFile: File, columns: List<TrackerColumn> = defaultColumns) : AbstractSolverStateTracker(source)

An autonomous tracker that logs continuous optimization progress to a CSV file. Automatically manages OS file locks to support multiple sequential solver runs appending cleanly to the same file.

Parameters

solver

The solver to track.

outputFile

The file to write the CSV data to.

columns

A list of TrackerColumns defining the CSV structure. Defaults to defaultColumns.

Constructors

Link copied to clipboard
constructor(solver: Solver, outputFile: File, columns: List<TrackerColumn> = defaultColumns)
constructor(solver: Solver, fileName: String)

Convenience constructor that creates a CSV file in the KSL output directory.

Types

Link copied to clipboard
object Companion

Functions

Link copied to clipboard
protected open override fun consume(snapshot: SolverStateSnapshot)

Defines how the concrete tracker handles the mathematical state payload.

Link copied to clipboard
protected open override fun onLifecycleEvent(status: SolverStatus)

Optional hook for subclasses to react to lifecycle changes (e.g., opening/closing files on INITIALIZED/COMPLETED).