4.3 A SIMULATOR FOR DISCRETE-EVENT SYSTEMS

A bottom–up simulator for discrete-event systems could be built just as the simulator for discrete-time systems was in Section 3.3. The algorithm would be nearly identical, with changes only to accommodate the definitions of the state transition function and output function of the discrete-event system. These changes would closely resemble the differences between the Resultant classes of the discrete-time and discrete-event simulators.

At any particular moment in time, most of the components in a large discrete-event system do not produce output or change state. If we are interested in just those moments when an event actually occurs, then a simple implementation, built in the mold of the discrete-time simulator, is wasteful of computational resources. There are three specific burdens that can be shed with a little effort.

The first burden is in the calculation of the network’s state transition and output functions. The internal, external, and confluent transition functions of the Resultant iterate through every atomic model in the network and either compute a new state for it or update its elapsed time. It is likely that only a handful of those components will actually change state, and if we can deal with just those models, then the cost of incrementing the elapsed times of the others can be avoided. When a model has many components, this savings is substantial.

The second burden is in the calculation of the network’s time advance function. ...

Get Building Software for Simulation: Theory and Algorithms, with Applications in C++ now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.