Designed Experiment
Facilitates the simulation of a model via an experimental design.
The map representing the factor and its associated string requires some further discussion. The naming convention for controls and random variable parameters 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.
Suppose factor A was associated with the worker's initial capacity and factor B was associated with the mean of the service time distribution, then the factor settings map would be mapOf(factorA to "Worker.initialCapacity", factorB to "ServiceTimeRV.mean") where factorA and factorB are references to the associated Factor instances.
Parameters
the name of the experiment for saving simulation results
The model to simulate.
A mapping between each factor and a string representing the name of the control or parameter to associate with the factor.
The design that will be simulated. The factors specified in the design must be contained in the factor settings.
a KSLDatabase that will hold the data from the experiment.
Constructors
Properties
The database observer of the model. Can be used to stop observing, etc. The observer is created to clear data before experiments. Assumes that if the user is re-running the design that existing data for the experiment should be deleted.
A default value for the number of replications per design point. Used only if specified greater that or equal to 1. This will overwrite the number of replications for every design point if specified greater than 0. By default, it is set to -1, causing the design points to use the specification from the design.
The number of design points executed in the base design (without replications)
The names of the responses or counters in the model
Returns the list of executed runs, one run for each design point simulated
Functions
Causes any previous simulation runs associated with the execution of design points to be cleared.
The regression data to perform the regression of the linear model
The regression data to perform the regression of the linear model
Perform the regression of the linear model for predicting the response.
Returns replicated design point information in the order that the points were executed as a data frame.
Each design point in the associated factorial design is replicated by the number of associated replications held in the property designPointReplications. This results in an expanded list of design points within a dataframe with repeated copies of the design points within the data frame. The number of copies of each design point is based on its associated number of replications. The data frame has columns (exp_name, rep_id, factor1, factor2, ..., factorN) where factorK is the name of the kth factor.
Returns a data frame that has columns (point, exp_name, rep_id, responseName, factor1, factor2, ..., factorN) 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. The dataframe provides the data for performing a response surfacing model for the named response.
Returns a data frame that has columns:
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.
Writes the results to a csv formatted file
Causes all design points to be simulated as presented by the design's default iterator using the number of replications specified by the design points.