ControlVariateDataCollector

class ControlVariateDataCollector @JvmOverloads constructor(model: Model, name: String? = null) : ModelElement(source)

Defines responses and controls for a control variate experiment. Collects the replication responses for the responses and for the controls. Must be created prior to running the simulation to actually collect any data. Uses a ReplicationDataCollector

Constructors

Link copied to clipboard
constructor(model: Model, name: String? = null)

Properties

Link copied to clipboard
Link copied to clipboard

The number of replications observed

Functions

Link copied to clipboard
fun addControlVariate(randomVariableName: String, meanValue: Double): ResponseCIfc

If the RandomVariable doesn't exist in the model then an error occurs

fun addControlVariate(rvSource: RandomVariableCIfc, meanValue: Double, controlAlias: String = rvSource.name): ResponseCIfc

If the random source doesn't exist in the model then an error occurs

Link copied to clipboard
fun addResponse(responseName: String)

The supplied name must be the name of the model element representing the desired response. If the name does not exist in the model, then nothing is added and no errors occur. Thus, this method fails silently.

fun addResponse(response: ResponseCIfc, responseAlias: String = response.name)

The response is added to the control variate data collector with the supplied responseAlias response alias. The default response alias is the name of the response within the model. If the response alias has already been added, then an exception occurs. That is, the response alias must be unique to the collector.

Link copied to clipboard
Link copied to clipboard
fun collectedData(responseName: String, numBatches: Int = numReplications, controlNames: List<String> = controlNames()): RegressionData

Returns the collected data ready for regression in the form of CVData.

Link copied to clipboard

The response data and then the control data is returned in the map.

Link copied to clipboard

The control names

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

Includes the model name, the id, the model element name, the parent name, and parent id