Monthly Archives: September 2016

A Simple Discrete-Event Simulation: Part 8

Today I automated the generation of entity IDs. First we create a basic counter.

Then we change the entity declarations to remove the explicit assignment of IDs as we have been doing.

That was pretty mindless, so let’s … Continue reading

Posted in Simulation | Tagged , | Leave a comment

A Simple Discrete-Event Simulation: Part 7

Today we’ll do some more streamlining. We’ll start by adding a new function to the futureEventsQueue object.

Then, instead of having to specify the “absolute” (vs. “advance”) flag in the initialization of a new entity object, we know we’ll … Continue reading

Posted in Simulation | Tagged , | Leave a comment

A Simple Discrete-Event Simulation: Part 6

Now that I’m sure the basics are working the way I’d like I want to see if I can streamline things some more. The first thing to do is recognize that the next item being pulled off the future events … Continue reading

Posted in Simulation | Tagged , | Leave a comment

A Simple Discrete-Event Simulation: Part 5

Adding a second entity works correctly.

104 minutes entity 1 created at time 0 entity 2 created at time 0 entity 1 updated at time 11 entity 2 updated at time 13 entity 1 updated at time 21 entity … Continue reading

Posted in Simulation | Tagged , | Leave a comment

A Simple Discrete-Event Simulation: Part 4

Here is code that actually runs. It creates a single entity, then updates it in a loop until the ending time is exceeded. The next steps will be to see how it works with multiple entities of the same kind … Continue reading

Posted in Simulation | Tagged , | Leave a comment