A Simple Discrete-Event Simulation: Part 30

The Exit component is always available to accept any entities sent to it. It doesn’t have to store any entities but only has to keep track of when they “arrive,” which means they are leaving the model. The Exit component does calculate and report the residence time of the entity in the entire system, however.

I added reporting of residence time in the Queue component, which can vary, and the Process component, which is currently always a fixed value. I also modified the order of operations just a hair so the reporting operations go in the order that makes the most sense.

(Click on the “Step” button to advance through the model, refresh the page to run it again.)

Here’s the code for the Exit component.

Now we have a working representation of the basic components of the kind of systems I’ve often worked with. There are a ton of things that could be done going forward, so we’ll work them in each day going forward.

This entry was posted in Simulation and tagged , . Bookmark the permalink.

Leave a Reply