TimeSeriesResponse

class TimeSeriesResponse @JvmOverloads constructor(parent: ModelElement, periodLength: Double, numPeriods: Int, responses: Set<ResponseCIfc> = emptySet(), counters: Set<CounterCIfc> = emptySet(), var acrossRepStatisticsOption: Boolean = false, name: String? = null) : ModelElement, TimeSeriesResponseCIfc(source)

This class addresses the problem of collecting simulation responses by period. A typical use case involves the reporting of statistics over fixed time periods, such as hourly, daily, monthly, yearly, etc. A time series response divides the simulated time horizon into sequential periods, with the periods marking the time frame over which performance is observed. Users specify which responses will be tabulated by providing Response, TWResponse, or Counter instances. Then for each period during the simulation horizon, the response over the period is recorded into a series of records, constituting a time series for the response. For Response and TWResponse instances, the recorded response represents the average of the variable during the period. For Counter instances, the total count during the period is recorded. This data is recorded for every response, for every period, for each replication. The response or counter information is recorded at the end of each completed period. The number of periods to collect must be supplied.

This class does not react to warm up events. That is, periods observed prior to the warmup event will contain data that was observed during the warmup period. The standard usage for this class is likely not within an infinite horizon (steady-state) context. However, if you do not want data collected during warmup periods, then specify the default start time for the time series to be greater than or equal to the specified warmup period length using the defaultStartTime property. The default starting time of the first period is at time 0.0.

The collected responses are not automatically shown in console output. However, the data can be accessed via a reference to the class or by using a KSLDatabase.

Parameters

parent

the parent model element for the time series response.

periodLength

the length of time for the period. This must be greater than zero.

responses

A set of responses to observe for each period. This set may be empty only if the counters set is not empty.

counters

A set of counters to observe for each period. This set may be empty only if the responses set is not empty.

acrossRepStatisticsOption

This option indicates that within memory statistics will be defined to collect statistics across the periods for each replication. This will result in statistics for each period for each response. The default is false.

name

the name of the model element

Constructors

Link copied to clipboard
constructor(parent: ModelElement, periodLength: Double, numPeriods: Int, response: ResponseCIfc, acrossRepStatisticsOption: Boolean = false, name: String? = null)
constructor(parent: ModelElement, periodLength: Double, numPeriods: Int, counter: CounterCIfc, acrossRepStatisticsOption: Boolean = false, name: String? = null)
constructor(parent: ModelElement, periodLength: Double, numPeriods: Int, response: ResponseCIfc, counter: CounterCIfc, acrossRepStatisticsOption: Boolean = false, name: String? = null)
constructor(parent: ModelElement, periodLength: Double, numPeriods: Int, responses: Set<ResponseCIfc> = emptySet(), counters: Set<CounterCIfc> = emptySet(), acrossRepStatisticsOption: Boolean = false, name: String? = null)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
Link copied to clipboard
open override val counters: List<CounterCIfc>

The counters associated with the time series response.

Link copied to clipboard
open override var defaultStartTime: Double

The default time that the first period will start. By default, it is zero.

Link copied to clipboard
@set:KSLControl(controlType = ControlType.INTEGER, lowerBound = 1.0)
var numPeriodsToCollect: Int
Link copied to clipboard
open override var periodCounter: Int

Counts the number of periods collected

Link copied to clipboard
open override var periodLength: Double

The length (in base time units) for the period

Link copied to clipboard
open override val responses: List<ResponseCIfc>

The responses associated with the time series response.

Functions

Link copied to clipboard

If the acrossRepStatisticsOption option is true, then this function returns the across replication statistics for each period for the specified counter. If the counter is not associated with the time series collector, then an empty map is returned.

If the acrossRepStatisticsOption option is true, then this function returns the across replication statistics for each period for the specified response. If the response is not associated with the time series collector, then an empty map is returned.

Returns a list of the across replication statistics by period where the statistics are computed replications.

Link copied to clipboard

Returns all time series period data as a data frame for responses and counters

Link copied to clipboard

Returns all time series period data as a list for responses and counters

Link copied to clipboard

If the collection has been scheduled to start or has started, this function cancels any further collection.

Link copied to clipboard
open override fun counterPeriodDataAsDataFrame(counter: CounterCIfc): DataFrame<TimeSeriesPeriodData>

Provides a data frame representation of the counter period data for the counter or an empty data frame if the counter is not collected.

Link copied to clipboard

Provides a data frame representation of the counter period data for the counter or an empty data frame if the counter is not collected.

Link copied to clipboard
open override fun responsePeriodDataAsDataFrame(response: ResponseCIfc): DataFrame<TimeSeriesPeriodData>

Provides a data frame representation of the response period data for the response or an empty data frame if the response is not collected.

Link copied to clipboard

Provides a data frame representation of the response period data for the response or an empty data frame if the response is not collected.