Agent Mailbox
A typed mailbox that holds AgentMessage values for a single AgentLike owner.
This is a POJO inner class — not a ModelElement, not backed by a BlockingQueue. Storage is a plain ArrayDeque; suspending receives use ksl.modeling.entity.ProcessModel.Entity.Suspension directly, which is KSL's per-entity custom-suspension primitive. This means a mailbox can be constructed at any time (notably, when its owning Agent is created during a replication).
Per-mailbox queue statistics are not collected. If you need them, register a Response/TWResponse observer at setup time via PermanentAgent and update it from your own send/receive call sites.
The mailbox is unbounded: deliver never blocks. Capacity-based back-pressure can be added later if needed.
Types
A scoped capture of messages matching predicate. While active, a matching message delivered to this mailbox is routed into the reservation's private buffer with priority over waiters, the pending queue, and arrival listeners — so a reserved conversation (e.g. a Contract-Net round) is never seen or consumed by an unrelated receiver on the same mailbox (a statechart onMessage handler, another receiveMessage). Call release when done.
Properties
Number of currently-registered MailboxObservers (for diagnostics).
Functions
Register a MailboxObserver to receive notifications on every delivery and consumption.
Non-suspending message insertion. If a process is currently suspended in receiveMessage with a matching predicate, hand the message directly to that waiter and resume it. Otherwise queue the message in pending and fire any registered arrival listeners.
Remove a previously-registered MailboxObserver. No-op if not attached.