ReplicationDataCollector

class ReplicationDataCollector(model: Model, addAll: Boolean = false, autoAttach: Boolean = true)

Collects and stores the replication average for each specified response or final value for each counter. Must be created prior to running the simulation for any data to be collected. The added responses or counters must already be part of the model. This is important. Only those responses or counters that already exist in the model hierarchy will be added automatically if you use the automatic add option.

The collector collects data at the end of each replication. Running the simulation multiple times within the same execution will record over any data from a previous simulation run. Use the various methods to save the data if it is needed prior to running the simulation again. Or, remove the collector as an observer of the model prior to running subsequent simulations.

Parameters

model

the model that has the responses, must not be null

addAll

if true then ALL currently defined response variables and counters within the

autoAttach

causes the collector to automatically be attached as an observer to the model when created. The default is true. If not attached automatically, then the startObserving() function needs to be called before running the model. model will be automatically added to the data collector. The default is false.

Constructors

Link copied to clipboard
constructor(model: Model, addAll: Boolean = false, autoAttach: Boolean = true)

Properties

Link copied to clipboard

The responses are ordered in the same order as returned by property responseNames and are the columns, each row for a column is the replication average, row 0 is replication 1

Link copied to clipboard

The array elements represent the within replication average for the responses or the ending value of the counters.

Link copied to clipboard
Link copied to clipboard

the number of replications collected so far

Link copied to clipboard

Functions

Link copied to clipboard

Adds all response variables and counters that are in the model to the data collector

Link copied to clipboard
Link copied to clipboard
fun addResponse(responseName: String)
fun addResponse(response: Response)
fun addResponse(response: ResponseCIfc)
Link copied to clipboard

Translates property allReplicationDataAsMap to Json string

Link copied to clipboard
Link copied to clipboard
operator fun contains(responseName: String): Boolean
Link copied to clipboard

If the counter name does not exist in the collector a zero length array is returned. The array elements represent the ending value of the counter within each replication.

Link copied to clipboard
fun replicationAverages(responseVariable: Response): DoubleArray

If the response name does not exist in the collector a zero length array is returned. The array elements represent the within replication average for the response.

Link copied to clipboard
fun replicationData(responseName: String): DoubleArray

If the response name does not exist in the collector a zero length array is returned. The array elements represent the within replication average for the response or the ending value of the counter.

Link copied to clipboard

Start observing the model

Link copied to clipboard

Stop observing the model

Link copied to clipboard
fun toDataFrame(): AnyFrame

Converts the data collected by the ReplicationDataCollector to a DataFrame, with the column names as the response names and the columns holding the data across replications

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

Provides a within replication view data representation of the collected data.