BatchCompletedComparisonSource

class BatchCompletedComparisonSource(result: RunResult.BatchCompleted, val sourceLabel: String = defaultLabel(result)) : ComparisonDataSourceIfc(source)

Scenario-host adapter that exposes a completed scenario sweep — the RunResult.BatchCompleted surfaced through whichever controller owns lastResult — as a ComparisonDataSourceIfc for the comparison analyzer UI.

Each scenario in result becomes one ExperimentRow. The experiment's response set is the union of names recorded across its ReplicationCompleted snapshots:

  • WithinRepStatTableData rows → ResponseCategory.OBSERVATION. The bridge does not separately tag observation vs time-weighted responses in within-rep records; the discrimination would require joining through the model-element table, which is only available to the (future) database adapter.

  • WithinRepCounterStatTableData rows → ResponseCategory.COUNTER.

observations returns per-replication values in rep_id order: for response statistics, the average field; for counters, the last_value field (the running count at end of replication).

Lookup is by experiment.exp_name — the authoritative scenario identifier the substrate populates from Model.experimentName, which the orchestrator sets from ScenarioSpec.name.

Constructors

Link copied to clipboard
constructor(result: RunResult.BatchCompleted, sourceLabel: String = defaultLabel(result))

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
open override val sourceLabel: String

Human-readable label for the source — shown in the comparison-analyzer header. Free-form; typical values: "Scenario run · 2025-05-15 · 4 scenarios", "Designed experiment · 12 points", "KSL database · queue-study.db".

Functions

Link copied to clipboard

All experiments available for comparison from this source, in source-natural order (commit order for scenarios, execution order for design points, table order for DB loads). Empty when the source has no experiments.

Link copied to clipboard
open override fun observations(experimentName: String, responseName: String): DoubleArray?

Per-replication observations for the given experimentName / responseName pair. Returns null when the experiment did not record that response, when the experiment is unknown, or when no per-replication data is available (counters that record only an end-of-replication count are surfaced as last_value and still return a one-value-per-rep array). Empty array is reserved for "experiment recorded the response but produced no values" — vanishingly rare in practice but worth distinguishing from "no recording at all".