MailboxAnimationEmitter

An AgentModel.MailboxObserver that emits AnimationEvent.AgentMessageDelivered on each delivery and AnimationEvent.AgentMessageConsumed on each consumption for one agent's mailbox. Attach one per agent (agent.mailbox.addObserver(MailboxAnimationEmitter(agent.name, model))); the mailbox is unchanged.

The mailbox callbacks carry only the message and the post-operation mailbox size (not the owning agent or the time), so each instance is bound to a single agentName and reads the current simulated time from Model.time. The message's runtime class name is used as the message type.

Parameters

agentName

the name of the mailbox's owning agent

model

the run-wide model, for its current time and animation sink

Constructors

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

Functions

Link copied to clipboard
open override fun onMessageConsumed(message: AgentMessage, currentSize: Int)
Link copied to clipboard
open override fun onMessageDelivered(message: AgentMessage, currentSize: Int)