Abstract
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 modelled 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. The implementation of this model is compared to a piece-by-piece simulator.