Response

A response represents an observational type variable for which observational statistics are automatically collected when the value of the response variable is assigned.

Parameters

parent

the parent model element containing this response

name

the unique name of the response. If a name is not assigned (null), a name will be assigned. A common naming convention would be to name the response based on the parent's name to ensure uniqueness within the context of the parent. For example, "${this.name}:SomeResponseName", where "this" refers to the parent.

initialValue

this is the initial value of the response variable. It is only used internally.

allowedDomain

This is an interval that defines the set of legal values for the response. By default, this is (NEGATIVE_INFINITY, POSITIVE_INFINITY). If supplied, this provides a method to check if invalid values are assigned to the response. For example, if the response represents time, you might want to change the allowed domain to not include negative values.

countLimit

specifies a limit that when reached will cause counter-actions to be invoked. By default, this is POSITIVE_INFINITY. A common count action would be to stop the simulation when a particular number of observations have been reached. By default, there are no count actions. Thus, if a count limit is specified, the user is responsible for providing what to do via the functions that add count actions. Otherwise, no actions occur when the limit is reached.

Inheritors

Constructors

Link copied to clipboard
constructor(parent: ModelElement, name: String? = null, allowedDomain: Interval = Interval(), countLimit: Double = Double.POSITIVE_INFINITY)

A response represents an observational type variable for which observational statistics are automatically collected when the value of the response variable is assigned.

Properties

Link copied to clipboard

Returns a StatisticAccessorIfc for the across replication statistics that have been collected on this Counter

Link copied to clipboard
open override var defaultReportingOption: Boolean

Returns the default reporting option. True means that the response should appear on the default reports

Link copied to clipboard
open override val domain: Interval

The legal range of values for the response

Link copied to clipboard
open override var emissionsOn: Boolean

If true, the response will emit a pair Pair(time, value) every time a new value is assigned

Link copied to clipboard
@set:KSLControl(controlType = ControlType.DOUBLE)
open override var initialCountLimit: Double

Sets the initial value of the count limit. Only relevant prior to each replication. Changing during a replication has no effect until the next replication.

Link copied to clipboard
Link copied to clipboard
open override var previousTimeOfChange: Double
Link copied to clipboard
open override var previousValue: Double

The previous value, before the current value changed

Link copied to clipboard

Changes the count action limit during the replication. WARNING: This value will automatically be reset to the initialCountLimit at the beginning of each replication so that each replication starts in the same state. If you want to control the count limit for each replication, you should use the initialCountLimit.

Link copied to clipboard
open override var timeOfChange: Double
Link copied to clipboard
Link copied to clipboard
open override var value: Double
Link copied to clipboard

Returns a reference to the underlying WeightedStatistic

Functions

Link copied to clipboard
open override fun addCountLimitAction(action: CountActionIfc)

Add an action that will occur when the count limit is achieved

Link copied to clipboard
open override fun addCountLimitStoppingAction(initialCountLimit: Int): CountActionIfc

Adds an action that will stop the replication when the count limit is reached.

Link copied to clipboard
fun attachIndicator(predicate: (Double) -> Boolean, name: String? = null): IndicatorResponse
Link copied to clipboard
open override fun removeCountLimitAction(action: CountActionIfc)

Remove an action associated with a count limit