StandardReportMaterializer

Renders one of the framework's standard simulation reports from a terminal RunResult into a per-run reports directory.

The actual rendering work delegates to the existing ksl.utilities.io.report framework:

  • Snapshot is extracted from RunResult.Completed.snapshot or RunResult.BatchCompleted.snapshots (first non-null).

  • Document is produced via SimulationSnapshot.ExperimentCompleted.toReport(), which composes run summary + across-replication stats + histograms + frequencies + time-series stats.

  • File is written via writeHtml(...) / writeMarkdown(...) / writeText(...) with a RenderContext rooted at the supplied reports directory so plot artifacts land alongside the report file.

Substrate-level API — usable by any UI shell (Swing default result panel, web download button, CLI report command). Returns the written File on success; the host decides what to do with it (open in browser, attach to email, copy to remote store, etc.).

Types

Link copied to clipboard
data class SectionOptions(val showRunSummary: Boolean = true, val showAcrossReplicationStats: Boolean = true, val showHistograms: Boolean = true, val showFrequencies: Boolean = true, val showTimeSeries: Boolean = true, val showDiagnostics: Boolean = false, val timeSeriesConfidenceLevel: Double = 0.95)

Options controlling which sections of the snapshot's standard report appear in the materialised document. Defaults match SimulationSnapshot.ExperimentCompleted.toReport()'s built-in defaults so callers that ignore this parameter get the pre-existing report content. A "Post-Run Reporting" panel typically surfaces these as checkboxes; auto-render uses the defaults.

Properties

Link copied to clipboard

Default file stem (without extension).

Functions

Link copied to clipboard

Extracts the snapshot to render from a terminal result, or null when none is available. BatchCompleted picks the first snapshot in commit order.

Link copied to clipboard
fun materialize(result: RunResult, format: StandardReportFormat, reportsDir: Path, fileStem: String = DEFAULT_FILE_STEM, title: String? = null, sections: StandardReportMaterializer.SectionOptions = SectionOptions.DEFAULT): StandardReportOutcome

Renders result's snapshot to format under reportsDir. Creates reportsDir (and its parents) if absent. The report file is named <fileStem>.<extension>.