Counter

open class Counter @JvmOverloads constructor(parent: ModelElement, name: String? = null, initialValue: Double = 0.0, countLimit: Double = Double.POSITIVE_INFINITY) : ModelElement, CounterIfc, CounterCIfc, DoublePairEmitterIfc(source)

Inheritors

Constructors

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

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
override val domain: Interval
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, name = "initialCounterLimit", lowerBound = 0.0)
open override var initialCounterLimit: 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
@set:KSLControl(controlType = ControlType.DOUBLE, name = "initialValue", lowerBound = 0.0)
open override var initialValue: Double

Sets the initial value of the variable. 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
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

Functions

Link copied to clipboard
open override fun addCountLimitAction(action: CountActionIfc)
Link copied to clipboard
open override fun addCountLimitStoppingAction(initialCountLimit: Int): CountActionIfc
Link copied to clipboard
fun increment(increase: Double = 1.0)

Increments the value of the variable by the amount supplied. Throws an IllegalArgumentException if the value is negative.

Link copied to clipboard
open override fun removeCountLimitAction(action: CountActionIfc)
Link copied to clipboard
fun resetCounter(value: Double, notifyUpdateObservers: Boolean)

Resets the counter to the supplied value.