SimulationRun

@Serializable
class SimulationRun : ToJSONIfc(source)

A SimulationRun represents the execution of a simulation with inputs (controls and parameters), and output (results). A run consists of a number of replications that were executed with the same inputs and parameters, which cause the creation of results for each response within each replication. The main purpose of SimulationRun is to transfer data about the execution of a simulation. It acts as a data transfer class.

After the simulation run is executed, the 'results' property will hold pairs (response name, array). The response name is the name of the model element associated with the response, and the array contains the observations of the response for each replication.

Constructors

Link copied to clipboard
constructor(modelIdentifier: String, experimentRunParameters: ExperimentRunParameters, inputs: Map<String, Double> = mapOf(), stringInputs: Map<String, String> = mapOf(), jsonInputs: Map<String, String> = mapOf(), runId: String? = null, runName: String? = null, modelConfiguration: Map<String, String>? = null)

Properties

Link copied to clipboard
var beginExecutionTime: Instant
Link copied to clipboard
var endExecutionTime: Instant
Link copied to clipboard

true if the run has been executed (i.e. beginExecutionTime has been set from its initial sentinel value of Instant.DISTANT_PAST).

Link copied to clipboard

true if an error occurred during execution (i.e. runErrorMsg is non-empty).

Link copied to clipboard

true if the run produced results (i.e. results is non-empty). Will be false after a fatal run error.

Link copied to clipboard
val id: String
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Returns the replication identifiers used during execution, or null if the run has not been executed.

Link copied to clipboard

Returns the per-replication wall-clock execution times in milliseconds as recorded by ksl.observers.SimulationTimer, or null if the run has not been executed.

Link copied to clipboard

The number of model responses recorded in results, excluding the internal bookkeeping keys "repNumbers" and "repTimings". Equivalent to responseNames.size.

Link copied to clipboard

The names of the model responses recorded in results, excluding the internal bookkeeping keys "repNumbers" and "repTimings".

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Functions

Link copied to clipboard
fun acrossReplicationStatistic(responseName: String, confidenceLevel: Double = 0.95): StatisticIfc?

Returns the across-replication StatisticIfc for a single responseName, or null when responseName is absent or is an internal bookkeeping key.

Link copied to clipboard
fun acrossReplicationStatistics(confidenceLevel: Double = 0.95): Map<String, StatisticIfc>

Returns a map from each response name to its across-replication StatisticIfc, computed from the per-replication observations in results.

Link copied to clipboard

Returns the per-replication observations for responseName, or null if the name is absent from results or is one of the internal bookkeeping keys ("repNumbers", "repTimings").

Link copied to clipboard
fun statisticalReporter(confidenceLevel: Double = 0.95): StatisticReporter

Returns a StatisticReporter containing the across-replication summary statistics for every response in this run.

Link copied to clipboard
open override fun toJson(): String
Link copied to clipboard
fun SimulationRun.toReport(title: String = "Simulation Run ", confidenceLevel: Double = 0.95, showTimings: Boolean = false, block: ReportBuilder.() -> Unit = { simulationRun(this@toReport, confidenceLevel, showTimings) }): ReportNode.Document

Builds a ReportNode.Document containing a full simulation run report via simulationRun.

Link copied to clipboard
open override fun toString(): String