adevs
adevs Documentation

This new version of the adevs (A Discrete EVent system Simulator) library supports the construction of discrete event models using a simple, messaging passing type API and the Parallel DEVS formalism. Ad hoc support is offered for dynamic structure models via methods for adding and removing models from the simulation kernel at runtime.

The message passing API offers many of the advantages of PDEVS: specifically, its natural resolution of parallel events and the assignment of a unique state to each instant of (super dense) time. At the same time, it is intuitive to use and does not require familiarity with the PDEVS formalism.

Support is also provided for the full Parallel DEVS formalism defined on a super dense time base. This support is based on the message passing API, and so models constructed using the two methods can be intermingled. Several texts are available for those who are not already familiar with DEVS in one of its many forms. See www.acims.arizona.edu for an extensive collection of tutorials, research papers, and alternate implementations of the DEVS formalism. Specific books and papers that influenced the development of this tool are

Question and comments about this software can be sent to its maintainer, Jim Nutaro, at nutarojj@ornl.gov.

Building models

A simulation program is constructed from a set of models, realized as instances of the Model class. The models are added to a simulation environment (sometimes called a simulation context) that managements time and communications between the models. The simulation context provides four services:

Each model implements four methods that are invoked by the simulation context as the computation proceeds, and the context's services may be accessed by the model at these times. These methods are:

The simulation time is described by a pair (t,c). The first element of the pair is the real time, which corresponds to some physically meaningful time relevant to the problem being solved. The second element is the logical time, and it orders actions that occur too quickly to be assigned distinct real times. Simulation time is ordered lexicographiclly. Specifically,

(t,c) < (h,k) iff t < h or (t=h and c < k).

Time is advanced by an operator indicated in the simulation code with +, but that does not coincide with the normal notion of addition. The + operator is defined to be

(t,c)+(h,k) = if h ≠ 0 then (t+h,k) else (t,c+k).

The next instant of simulation time following (t,c) is (t,c)+(0,1)=(t,c+1). Hence, if a message is sent at time (t,c) it will be delivered at (t,c+1). Likewise, if the update() or init() method is invoked at (t,c) it must return a time greater than or equal to (t,c+1). A model removed at (t,c) has its fini() method called at (t,c+1).

Given two time points (t,c) < (h,k) the interval [(t,c),(h,k)) has a length equal to

(h,k)-(t,c) = if h = t then (0,k-c) else (h-t,k).

This is used to calculate the elapsed time for a Parallel DEVS model.

Sample simulation programs can be found in the examples directory. These, in conjunction with the information above and possibly a book on Parallel DEVS will be the best way to get started building simulation programs. Here is a list of examples that are available to get you started.