CounterCIfc

interface CounterCIfc

While Counter instances should in general be declared as private within model elements, this interface provides the modeler the ability to declare a public property that returns an instance with limited ability to change and use the underlying Counter, prior to running the model.

For example:

private val myC = Counter(this, "something cool") val counter: CounterCIfc get() = myC

Then users of the public property can change the response and do other controlled changes without fully exposing the private variable. The implementer of the model element that contains the private counter does not have to write additional functions to control the counter and can use this strategy to expose what is needed. This is most relevant to setting up the model elements prior to running the model or accessing information after the model has been executed. Changes or use during a model run is readily available through the general interface presented by Counter.

The naming convention "CIfc" is used to denote controlled interface.

Inheritors

Properties

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
abstract val emissionsOn: Boolean

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

Link copied to clipboard

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
abstract 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.

Functions

Link copied to clipboard
abstract fun addCountLimitAction(action: CountActionIfc)
Link copied to clipboard
abstract fun addCountLimitStoppingAction(initialCountLimit: Int): CountActionIfc
Link copied to clipboard