Mailbox Animation Emitter
class MailboxAnimationEmitter(agentName: String, model: Model) : AgentModel.MailboxObserver<AgentMessage> (source)
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
agent Name
the name of the mailbox's owning agent
model
the run-wide model, for its current time and animation sink