Discrete Event

The ERG (Event Relationship Graph) domain is a discrete-event model of computation. A model in ERG is represented with a graph of nodes and edges, where nodes represent events and directed edges between events represent scheduling relation. One or more events can be selected as initial events, which are scheduled at model time 0.0. When an event is fired, it possibly performs certain actions, and if there are outgoing edges from that event, the events at the end points of those edges are scheduled after non-negative delays. One or more events can also be selected as final events. The firing of final events causes the event queue to be emptied after their actions are performed, and therefore no more events can be processed.

The ERG domain supports a different kind of modal models called ERGModalModels, compared to modal models using FSMs (Finite State Machines) as the control. An ERGModalModel uses ERG at the top level, and each event is refined into a sub-model. The refinements can use ERG and any other Ptolemy models of computation.

An ERG model is timed. Although it should work in many domains, the DE (Discrete-Event) domain or ERG domain itself are recommended. When embedded in those domains, the scheduling of the ERG model is delegated to the container by calling the fireAt() function of its director.

There are many useful additional features for ERG, such as canceling edges and parameters. A canceling edge, denoted by a dotted line, cancels a previously scheduled event instead of scheduling a new one. If the pointed to event has multiple instances in the event queue, then the first instance is cancelled. Events may also have parameters, and the actual values for those parameters are specified by the expressions on the edges that schedule them. Those expressions are evaluated at run-time. The events may refer to the values of those parameters in their actions by parameter names.

The following paper by Lee W. Schruben provides indepth information about ERG:

References

  1. Lee W. Schruben, "Simulation Modeling with Event Graphs," Communications of the ACM (CACM), 26(11): 957-963, 1983.