Discrete Event Modeling in Ptolemy II

Lukito Muliadi

Department of Electrical Engineering and Computer Science
University of California, Berkeley, CA, USA 94720
May 18, 1999



This report describes the discrete-event semantics and its implementation in the Ptolemy II software architecture. The discrete-event system representation is appropriate for time-oriented systems such as queueing systems, communication networks, and hardware systems. A key strength in our discrete-event implementation is that simultaneous events are handled systematically and deterministically. A formal and rigorous treatment of this property is given. One of the Ptolemy II major features is in the heterogenous modeling of systems. Composition of the DE domain with different domains in Ptolemy II is discussed. The performance of a discrete-event simulator depends heavily on the algorithm by which events are maintained and sorted in the event queue. In the Ptolemy II DE domain, the event queue is implemented as the calendar queue data structure. The calendar queue is an extremely fast implementation of the priority queue with time complexity equal to O(1) for both enqueue and dequeue operations. A comprehensive description of this data structure is given. Based on the tagged signal model, the formal semantics of our discrete event implementation are given in terms of the firing functions of actors.