KSLDatabase

class KSLDatabase @JvmOverloads constructor(db: Database, clearDataOption: Boolean = false) : DatabaseIOIfc(source)

Constructors

Link copied to clipboard
constructor(db: Database, clearDataOption: Boolean = false)
constructor(dbName: String, dbDirectory: Path = dbDir, clearDataOption: Boolean = true)

This constructs a SQLite database on disk and configures it to hold KSL simulation data. The database will be empty.

Types

Link copied to clipboard
object Companion

Properties

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

If true the underlying database was configured as a KSLDatabase

Link copied to clipboard

Returns the names of the experiments in the EXPERIMENT table.

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

Functions

Link copied to clipboard

Retrieves the across-replication statistic records associated with the named experiment.

Link copied to clipboard

Retrieves the batch-statistic records associated with the named experiment.

Link copied to clipboard

Clears all data from user defined tables

Link copied to clipboard

Deletes all simulation data associated with the supplied model. In other words, the simulation run data associated with a simulation with the name and the experiment with the name.

Link copied to clipboard

Retrieves the control records associated with the named experiment. Returns an empty list if no experiment with expName exists.

Link copied to clipboard

The expName should be unique within the database. Many experiments can be run with different names for the same simulation. This method deletes the experiment record with the provided name AND all related data associated with that experiment. If an experiment record does not exist with the expName, then nothing occurs.

Link copied to clipboard

Deletes by manual cascading any records related to the experiment with the provided name. If the database does not contain the specified experiment, then nothing occurs.

Link copied to clipboard

Checks if the supplied experiment name exists within the database. Experiment names should be unique within the database

Link copied to clipboard

Retrieves the data for the named experiment or null if an experiment with the provided expName name is not found in the database

Link copied to clipboard

Returns all frequency cell records associated with the named experiment, or an empty list if the experiment is not found or has no frequency data.

Link copied to clipboard

Returns all histogram bin records associated with the named experiment, or an empty list if the experiment is not found or has no histogram data.

Link copied to clipboard

Retrieves the model-element records associated with the named experiment. Returns an empty list if no experiment with expName exists.

Link copied to clipboard

This prepares a map that can be used with MultipleComparisonAnalyzer and returns the MultipleComparisonAnalyzer. If the set of simulation runs does not contain the provided experiment name, then an IllegalArgumentException occurs. If there are multiple simulation runs with the same experiment name, then an IllegalArgumentException occurs. In other words, when running the experiments, the user must make the experiment names unique in order for this map to be built.

Returns a map of maps. The outer map has the experiment name as its key. The inner map has the response's name as the key and the replication results as a double array. The array contains the observed replication statistic for the response variable or the final count for a counter for each replication.

Link copied to clipboard

Returns a map of maps. The outer map has the experiment name as its key. The inner map has the response's name as the key and the replication results as a list of double values. The list contains the observed replication statistic for the response variable or the final count for a counter for each replication.

Link copied to clipboard

Retrieves the random-variable parameter records associated with the named experiment. Returns an empty list if no experiment with expName exists.

Link copied to clipboard

Retrieves the simulation-run records associated with the named experiment. Returns an empty list if no experiment with expName exists.

Link copied to clipboard

Retrieves the time-series response records associated with the named experiment.

Link copied to clipboard
fun KSLDatabase.toComparisonReport(responseName: String, expNames: List<String>, title: String = "Comparison — ", direction: MCBDirection = MCBDirection.BOTH, indifferenceZone: Double? = null, confidenceLevel: Double = 0.95, probCorrectSelection: Double = 0.95, showAltCIPlot: Boolean = true, showBoxPlot: Boolean = true): ReportNode.Document

Builds a ReportNode.Document containing a complete multiple-comparison analysis of one response across several experiments stored in this database.

Link copied to clipboard
fun KSLDatabase.toFrequencyReport(expName: String, name: String? = null, title: String = if (name == null) "Frequencies — $expName" else "Frequency — $name ($expName)", showPlot: Boolean = true): ReportNode.Document

Builds a ReportNode.Document for the stored integer-frequency data of one experiment.

Link copied to clipboard
fun KSLDatabase.toHistogramReport(expName: String, responseName: String? = null, title: String = if (responseName == null) "Histograms — $expName" else "Histogram — $responseName ($expName)", showPlot: Boolean = true): ReportNode.Document

Builds a ReportNode.Document for the stored histogram data of one experiment.

Link copied to clipboard
fun KSLDatabase.toReport(title: String = label, confidenceLevel: Double = 0.95, showPlots: Boolean = true): ReportNode.Document

Builds a ReportNode.Document covering all experiments stored in this database.

fun KSLDatabase.toReport(expName: String, title: String = expName, confidenceLevel: Double = 0.95, showPlots: Boolean = true, block: ReportBuilder.() -> Unit = { dbSimulationResults(this@toReport, expName, confidenceLevel, showPlots) }): ReportNode.Document

Builds a ReportNode.Document for a single named experiment in this database.

Link copied to clipboard
fun KSLDatabase.toTimeSeriesReport(expName: String, responseName: String? = null, title: String = if (responseName == null) "Time Series — $expName" else "Time Series — $responseName ($expName)", confidenceLevel: Double = 0.95, showPlots: Boolean = true): ReportNode.Document

Builds a ReportNode.Document of the stored time-series data for one experiment.

Link copied to clipboard
fun KSLDatabase.toWithinReplicationReport(expName: String, responseName: String, title: String = "Within-Replication — ", confidenceLevel: Double = 0.95, showPlots: Boolean = true): ReportNode.Document

Builds a ReportNode.Document containing the full within-replication diagnostic set for one response in one experiment stored in this database.

Link copied to clipboard

Retrieves the within-replication counter-statistic records associated with the named experiment.

Link copied to clipboard

Returns the observations for the named experiment and the named statistical response from the within replication data. If the experiment name expNameStr is not found, then an empty array is returned. If the experiment is found, but the response name statNameStr is not found, then an empty array is returned.

Link copied to clipboard

This prepares a map that can be used with MultipleComparisonAnalyzer. If the set of simulation runs does not contain the provided experiment names, then an IllegalArgumentException occurs. If there are multiple simulation runs with the same experiment name, then an IllegalArgumentException occurs. In other words, when running the experiments, the user must make the experiment names unique in order for this map to be built.

Link copied to clipboard

Retrieves the within-replication response-statistic records associated with the named experiment.

Link copied to clipboard

Returns a list containing the within replication data

Link copied to clipboard
fun withinRepViewStatistics(responseName: String): AnyFrame

Returns a data frame that has columns (exp_name, rep_id, responseName) where the values in the responseName column have the value of the response for the named experiments and the replication id (number) for the value.