A Faster Implementation of DEVS in the Joint MEASURE Simulation Environment Steven B. Hall, Shankar M. Venkatesan, Donald B. Wood 1 , Advanced Simulation Center, Lockheed Martin Space Systems, Sunnyvale, CA 94088 Abstract: The University of Arizona definition and implementation of the DEVS framework is well known in the community of researchers that work on DEVS [1,2,6]. Not only does it provide an Object-Oriented implementation in C++ (and Java), but it also has a tight HLA connectivity (which was replaced by the HLA Interface developed at Lockheed Martin [4,5]). We present a faster and more efficient implementation of the University of Arizona DEVS here, which improves and clarifies many features of their implementation. 1. Our Results The University of Arizona DEVS and DEVSHLA implementations have served as the simulation engine on which the discrete event simulation framework called Joint MEASURE (JM for short) was developed at Lockheed Martin. In the process of building many critical and large scale simulations based on Joint MEASURE over the past few years, we realized that a significant fraction of the time inefficiency in our runs was coming from the actual design of the DEVS implementation. This is especially so when, during the simulation, the number of models that change state at any given instant was a small fraction of the total number of models. We made it a goal to look into this DEVS implementation, and improve the situation at the first opportunity. This paper describes the successful culmination of this effort. In this work, we present the following results that: (a) enhance the role of the external inports and outports in the models by providing the ports with real data transfer roles (b) implement a templated priority queue which serves as a repository of models keyed by various single fields (e.g. their “imminent” times or names) or by a totally ordered sequence of fields (c) precompute the mail destinations (and origins) for each port for saving time and selectively update these precomputed Destination and Origin sets when links, ports, or models are dynamically added to or deleted from the simulation (d) eliminate inefficient classes for data structures and replace them with typesafe templated classes and (e) provide data that compares the performance of the old and the new implementations. 2. DEVS and the Previous Implementation The Discrete Event Systems (DEVS) formalism [1,2] succinctly captures time interactions between hierarchically interconnected automata or finite state machines. Therefore any time-efficient implementation of DEVS is highly suitable as the engine behind the modeling and simulation of a hierarchically specified discrete system. Many important problems in science, technology, and engineering can be modeled in such a fashion, and would benefit from an attempt to improve the efficiency and clarify the implementation. The previous implementation of DEVS that we used as the basis of the Joint MEASURE concept worked along the following well known general lines: The simulation models are represented in a model tree, where the leaves represented Atomic Models and the interior nodes represented Coupled Models. The models