StatechartAnimationEmitter

An AgentModel.StatechartObserver that emits agent statechart events: AnimationEvent.AgentStateEntered, AnimationEvent.AgentStateExited, and AnimationEvent.AgentTransition. Attach one per agent to that agent's statechart (agent.statechart?.addObserver(StatechartAnimationEmitter(agent.name, model))).

Because the statechart callbacks carry only the state name and time (not the agent), each instance is bound to a single agentName.

Parameters

agentName

the name of the agent whose statechart this observes

model

the run-wide model, for its animation sink

Constructors

Link copied to clipboard
constructor(agentName: String, model: Model)

Functions

Link copied to clipboard
open override fun onStateEntered(stateName: String, time: Double)

Fires after entry actions have run for the entered state.

Link copied to clipboard
open override fun onStateExited(stateName: String, time: Double)

Fires after exit actions have run for the exited state.

Link copied to clipboard
open override fun onTransition(fromState: String, toState: String, time: Double)

Fires once per completed transition, after both exit actions of fromState and entry actions of toState have run. A self-transition (transitionTo current state) still counts.