State

open class State(theStateNumber: Int = stateCounter + 1, name: String = "State:", useStatistic: Boolean = false) : IdentityIfc, StateAccessorIfc

Create a state with given name and indicate usage of a Statistic object to collect additional statistics

Parameters

name

The name of the state

theStateNumber

a number assigned to the state for labeling purposes

useStatistic

True means collect sojourn time statistics

Constructors

Link copied to clipboard
constructor(theStateNumber: Int = stateCounter + 1, name: String = "State:", useStatistic: Boolean = false)

Properties

Link copied to clipboard
open override val id: Int
Link copied to clipboard
open override var isEntered: Boolean

indicates whether currently in the state

Link copied to clipboard
open override var label: String?
Link copied to clipboard
open override val name: String
Link copied to clipboard
val number: Int

A user defined integer label for the state

Link copied to clipboard
open override var numberOfTimesEntered: Double

number of times the state was entered

Link copied to clipboard
open override var numberOfTimesExited: Double

number of times the state was exited

Link copied to clipboard

Indicates whether statistics should be collected on time spent in the state. The default is false

Link copied to clipboard
open override var sojournTimeStatistic: Statistic?

statistical collector

Link copied to clipboard
open override var timeFirstEntered: Double

time that the state was entered for the first time

Link copied to clipboard
Link copied to clipboard
open override var timeStateEntered: Double

time the state was last entered

Link copied to clipboard
open override var timeStateExited: Double

time the state was last exited

Link copied to clipboard
open override var totalTimeInState: Double

Total time spent in state

Functions

Link copied to clipboard
fun enter(time: Double)

Causes the state to be entered If the state has already been entered then nothing happens. Preconditions: time must be >= 0, must not be Double.NaN and must not be Double.Infinity

Link copied to clipboard
fun exit(time: Double): Double

Causes the state to be exited

Link copied to clipboard

Initializes the state back to new

Link copied to clipboard

Resets the statistics collected on the sojourn time in the state

Link copied to clipboard

Resets the counters for the number of times a state was entered, exited, and the total time spent in the state This does not affect whether or the state has been entered, the time it was last entered, or the time it was last exited. To reset those quantities and the state counters use initialize()

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