Package-level declarations

Types

Link copied to clipboard
open class CentralCompositeDesign @JvmOverloads constructor(val twoLevelDesignItr: FactorialDesign.FactorialDesignIterator, val numFactorialReps: Int = 1, val numAxialReps: Int = 1, val numCenterReps: Int = 1, val axialSpacing: Double, name: String? = null) : Identity, ExperimentalDesignIfc

A central composite design represent a two-level factorial design that has been augmented with a center point and axial point to enable the modeling of quadratic response surface models.

Link copied to clipboard
class ConcurrentScenarioRunner @JvmOverloads constructor(name: String, scenarioList: List<Scenario> = emptyList(), val pathToOutputDirectory: Path = KSL.createSubDirectory(sanitizeForFilesystem(name) + "_OutputDir"), val kslDb: KSLDatabase = KSLDatabase("${sanitizeForFilesystem(name)}.db", pathToOutputDirectory), useScenarioOutputDirs: Boolean = true) : Identity

Executes a list of Scenario instances concurrently and writes all results to a shared KSLDatabase.

Link copied to clipboard

Coroutine-aware runner for one simulation model and one SimulationRun.

Link copied to clipboard
class DesignedExperiment @JvmOverloads constructor(name: String, model: Model, factorSettings: Map<Factor, String>, val design: ExperimentalDesignIfc, val kslDb: KSLDatabase = KSLDatabase("${name}.db".replace(" ", "_"), model.outputDirectory.dbDir)) : Identity, DesignedExperimentIfc

Facilitates the simulation of a model via an experimental design.

Link copied to clipboard

Lightweight reporting and analysis surface shared by designed experiments.

Link copied to clipboard

A design point is a specification of the settings for the factors of an experiment.

Link copied to clipboard
data class DesignPointInfo(val point: Int, val exp_name: String, val rep_id: Int)
Link copied to clipboard
Link copied to clipboard

Defines how design points in a ParallelDesignedExperiment are positioned in the model's random-number streams.

Link copied to clipboard
object DurationSerializer : KSerializer<Duration>
Link copied to clipboard
class ExperimentalDesign @JvmOverloads constructor(factors: Set<Factor>, name: String? = null) : Identity, ExperimentalDesignIfc

An experimental design represents a set of factors with design points. This permits the execution of a model using the factors and their levels

Link copied to clipboard
Link copied to clipboard
@Serializable
data class ExperimentRunDefaults(val numberOfReplications: Int, val numChunks: Int, val startingRepId: Int, val lengthOfReplication: Double, val lengthOfReplicationWarmUp: Double, val replicationInitializationOption: Boolean, val maximumAllowedExecutionTimePerReplication: Duration, val resetStartStreamOption: Boolean, val advanceNextSubStreamOption: Boolean, val antitheticOption: Boolean, val numberOfStreamAdvancesPriorToRunning: Int, val garbageCollectAfterReplicationFlag: Boolean)

Model-intrinsic defaults for the run-parameter surface of an experiment.

Link copied to clipboard
@Serializable
data class ExperimentRunParameters(var experimentName: String, val experimentId: Int, var numberOfReplications: Int, var numChunks: Int, var runName: String, var startingRepId: Int, var lengthOfReplication: Double, var lengthOfReplicationWarmUp: Double, var replicationInitializationOption: Boolean, var maximumAllowedExecutionTimePerReplication: Duration, var resetStartStreamOption: Boolean, var advanceNextSubStreamOption: Boolean, var antitheticOption: Boolean, var numberOfStreamAdvancesPriorToRunning: Int, var garbageCollectAfterReplicationFlag: Boolean) : ExperimentRunParametersIfc

Holds data about the run parameters of a simulation experiment.

Link copied to clipboard
open class Factor @JvmOverloads constructor(name: String, values: DoubleArray = doubleArrayOf(-1.0, 1.0)) : Identity

This class represents an individual factor within a factorial design. The name of the factor must be provided and will be required to be unique when placed within a design. The supplied values of the levels must be strictly increasing. That is, they must be unique and increasing in value.

Link copied to clipboard
open class FactorialDesign @JvmOverloads constructor(factors: Set<Factor>, name: String? = null) : Identity, ExperimentalDesignIfc

A factorial design represents a list of design points where every design point represents a possible row in the cartesian product of the levels for the factors. That is, all possible combinations of the levels for the factors are possible design points. A design point is individually generated when needed via the associated iterator for the design.

Link copied to clipboard
class LinearModel @JvmOverloads constructor(val mainEffects: Set<String>, type: LinearModel.Type = Type.FirstOrder)

This class provides the ability to specify a linear model (for use in regression and design of experiments). This is only a string specification of the model. The terms are specified by the names of the factors.

Link copied to clipboard
class ParallelDesignedExperiment @JvmOverloads constructor(name: String, modelBuilder: ModelBuilderIfc, factorSettings: Map<Factor, String>, val design: ExperimentalDesignIfc, val modelConfiguration: Map<String, String>? = null, val pathToOutputDirectory: Path = KSL.createSubDirectory(name.replace(" ", "_") + "_OutputDir"), val kslDb: KSLDatabase = KSLDatabase("${name}.db".replace(" ", "_"), pathToOutputDirectory), experimentName: String? = null, useDesignPointOutputDirs: Boolean = true, lengthOfReplication: Double? = null, lengthOfReplicationWarmUp: Double? = null) : Identity, DesignedExperimentIfc
Link copied to clipboard
class Scenario(val modelBuilder: ModelBuilderIfc, name: String, inputs: Map<String, Double> = emptyMap(), stringInputs: Map<String, String> = emptyMap(), jsonInputs: Map<String, String> = emptyMap(), runParameters: ExperimentRunParameters, modelConfiguration: Map<String, String>? = null, val modelConstructionMode: ScenarioModelConstructionMode = ScenarioModelConstructionMode.MODEL_BUILDER) : Identity

A scenario is a specification of a model to run with a fixed set of inputs and run parameters. Each call to simulate produces a new SimulationRun.

Link copied to clipboard

Describes how a Scenario obtains the ksl.simulation.Model used for execution.

Link copied to clipboard
class ScenarioRunner @JvmOverloads constructor(name: String, scenarioList: List<Scenario> = emptyList(), val pathToOutputDirectory: Path = KSL.createSubDirectory(sanitizeForFilesystem(name) + "_OutputDir"), val kslDb: KSLDatabase = KSLDatabase("${sanitizeForFilesystem(name)}.db", pathToOutputDirectory)) : Identity

Facilitates the running of many scenarios in a sequence. A KSLDatabase is used to capture the statistics for each scenario. Each scenario is treated like a different experiment. The scenarios can be based on the same or different models. The scenarios also capture the inputs and results via a SimulationRun.

Link copied to clipboard
fun interface ScenarioSetupIfc

Can be used to supply logic to configure a model prior to simulating a scenario.

Link copied to clipboard
@Serializable
class SimulationRun : ToJSONIfc

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.

Link copied to clipboard
class SimulationRunner(model: Model)

The purpose of this class is to facilitate the running of a simulation model based on some inputs and experimental run parameters. The simulate() functions take in the inputs and the experimental run parameters, and after execution return an instance of SimulationRun.

Link copied to clipboard
class TwoLevelFactor(name: String, low: Double = -1.0, high: Double = 1.0) : Factor

Creates a two level factor with provided low and high values.

Link copied to clipboard
class TwoLevelFactorialDesign @JvmOverloads constructor(factors: Set<TwoLevelFactor>, name: String? = null) : FactorialDesign

Functions

Link copied to clipboard
fun List<Scenario>.assignIndependentStreamAdvances(scenarios: IntProgression = indices, startingStreamAdvance: Int = 0, streamAdvanceSpacing: Int? = null): List<Scenario>

Assigns non-overlapping pre-run sub-stream advances to the selected scenarios.

Link copied to clipboard
fun main()
Link copied to clipboard
fun List<DesignPoint>.toDataFrame(coded: Boolean = false): AnyFrame

Turns the list of design points into a data frame. The columns of the data frame are the factor names and the rows are the design points values.