Discrete Event Simulation

Written by Norbert Hajagos

Intro

Part 1

Part 2

Part 3

Part 4

Questions and Challanges

  1. In the industry, you are usually not writing your own event loop. One small step towards creating a des library would be an event loop that executes event handlers for arbitrary events. You would specify the event type and a handler; the library would do the rest! The How would you implement that? What is the benefit of the current implementation compared to that?
  2. Implement event cancellation, so that we can remove a patient’s Interaction event from the event queue when a patient leaves the system.
  3. What if the triage is so important that all patients are willing to wait, no matter the length of the queue? In this case there would be no Err QueueWasFull on enqueuing, but the queue would grow dynamically (maybe patients wait in the hall… or on the street?) Modify the Queue to grow that way. The current implementation is pretty efficient. How could you keep close to it?