ScenarioOrchestrator

Orchestrates a scenario-sweep run from a RunConfiguration whose RunConfiguration.scenarios list is non-empty.

Low-level API note: application and UI code should prefer KSLAppSession, which owns scope lifecycle, validation, warning emission, and dispatch across all supported run modes. This orchestrator remains public so lower-level tests and advanced integrations can exercise scenario execution directly.

Each ksl.app.config.ScenarioSpec is translated into a Scenario with a ModelBuilderIfc that builds a fresh model for each scenario and applies the merged (parent + scenario) controls and RV overrides. Scenarios run concurrently via ConcurrentScenarioRunner.

The returned RunHandle emits:

The resolved RunResult is RunResult.BatchCompleted carrying the OrchestratorSummary and one SimulationSnapshot.ExperimentCompleted per successfully completed scenario.

Constructors

Link copied to clipboard
constructor()

Functions

Link copied to clipboard
fun submit(config: RunConfiguration, provider: ModelProviderIfc? = null, scope: CoroutineScope = CoroutineScope(SimulationDispatcher.default + SupervisorJob()), preRunWarnings: List<RunWarningType> = emptyList()): RunHandle

Submits the scenario sweep described by config for asynchronous execution.