Simulation Runner
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.
There are two key issues to note when using this class. First, you should strongly consider changing the name of the experiment associated with the model when repeatedly executing the simulate() function. This will facilitate the identification of the experiment associated with the simulation run within databases and other output mechanisms.
The second issue is the specification of the map of inputs. This map of (String, Double) pairs represents the inputs to the simulation model as specified by controls and the parameters of random variables within the model. The naming convention is important to note. For controls, by default, the key to associate with the value is the model element's name concatenated with the property that was annotated with the control. For example, if the resource had name Worker and annotated property initialCapacity, then the key will be "Worker.initialCapacity". Note the use of the "." character to separate the model element name and the property name. Since, the KSL model element naming convention require unique names for each model element, the key will be unique for the control. However, the model element name may be a very long string depending on your approach to naming the model elements. The name associated with each control can be inspected by asking the model for its controls via model.controls() and then using the methods on the Controls class for the names. The controlsMapAsJsonString() or asMap() functions are especially helpful for this purpose.
For the parameters associated with random variables, the naming convention is different. Again, the model element name is used as part of the identifier, then the value of rvParamConCatString from the companion object is concatenated between the name of the model element and the name of its parameter. For example, suppose there is a random variable that has been named ServiceTimeRV that is exponentially distributed. Also assume that rvParamConCatString is ".", which is its default value. Then, to access the mean of the service time random variable, we use "ServiceTimeRV.mean". Thus, it is important to note the name of the random variable within the model and the KSL's default names for the random variable parameters. When random variables are not explicitly named by the modeler, the KSL will automatically provide a default unique name. Thus, if you plan to control a specific random variable's parameters, you should strongly consider providing an explicit name. To get the names (and current values) of the random variable parameters, you can print out the toString() method of the RVParameterSetter class after obtaining it from the model via the model's rvParameterSetter property.
Functions
Splits the number of replications into a list of experiments with each experiment having at most size replications. A resulting experiment may have fewer than the given size but at least 1 replication. The experiments are ordered in the list such that the replication identifiers for each experiment are ordered from 1 to the number of replications numReplications
Simulates the model based on the current settings of the experiment run parameters and inputs associated with the simulation run simulationRun
The model will be run with the experimentRunParameters and the provided inputs. The inputs can represent both control (key, value) pairs and random variable parameter (key, value) pairs to be applied to the experiment. The inputs may be empty.
The model will be run with the provided inputs based on the current run parameters (model.extractRunParameters()) associated with the model.