ComparisonDataSourceIfc

Read-only access to a collection of "experiments" whose per-replication response observations can be pulled for cross-experiment comparison analyses (box plots, multiple- comparison analysis, confidence-interval plots).

An experiment here is the unit of comparison the analyst picks among: one scenario from a scenario sweep, one design point from a designed experiment, or one experiment loaded from a saved KSLDatabase. The interface deliberately uses the generic word "experiment" so the same component can drive any of those workflows.

Implementations are adapters — they translate a host-specific data shape (e.g. RunResult.BatchCompleted, DesignedExperimentIfc, KSLDatabase) into the small surface this interface exposes. The comparison-analyzer UI knows about this interface only; it does not know which adapter is feeding it.

Designed for multi-source extension: hosts accept a List<ComparisonDataSourceIfc> so a future workflow can compare experiments across two prior runs by loading two adapters. v1 implementations and the v1 hosts work with a single source.

Inheritors

Properties

Link copied to clipboard
abstract 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
abstract 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".