Skip to main content

Module event_queue

Module event_queue 

Source
Expand description

Continuous-time event-queue model.

EventQueueModel mirrors Julia Agents.jl EventQueueABM. Instead of fixed-tick stepping, agents schedule events at arbitrary future times. A deterministic priority queue processes events in chronological order, with tie-breaking by insertion sequence number.

§Event processing

  1. Pop the earliest event from the queue.
  2. Advance model time to the event’s timestamp.
  3. Look up the target agent; skip if removed.
  4. Call the action function indexed by event_idx.
  5. Apply any deferred add/remove actions.

Events for removed agents are silently skipped (not an error).

§Determinism

Events with identical timestamps are ordered by a monotonic sequence number assigned at insertion time.

Replay is deterministic for a fixed seed when all of the following are held constant:

  • the same initial event insertion order
  • the same action functions
  • the same event rescheduling behavior inside actions
  • the same agent add/remove behavior

Equal-time events are therefore reproducible by construction, but changing the order in which they are inserted will intentionally change execution order.

Structs§

Event
A scheduled event in the queue.
EventContext
Context passed to event-queue action callbacks during EventQueueModel::step_event.
EventQueueModel
Continuous-time agent-based model driven by an event queue.