Event driven model of an unreliable production line with storage

We have developed an event-driven algorithm for simulating a factory production line with storage. Using this algorithm, a production line, with an arbitrary number of machines each processing items at different rates and with buffers of any size, can be modeled efficiently. The algorithm is based on computing the time to the next event for each buffer and machine, where the events are: a buffer becomes full, a buffer becomes empty, a machine fails, and a machine is repaired. By collapsing the production line to exclude empty buffers that stay empty and full buffers that stay full, piece-by-piece computation is avoided. Computation time is reduced further by updating a buffer only when the input or output rate of that buffer changes or when the state of that buffer changes. An example of a line consisting of 100 machines and 99 buffers illustrates the efficiency of the model.