Finite & Deterministic Discrete Event System Specification - Examples

Examples

Ping-Pong Game

Let's consider a single ping-pong match in which there are two players. Each player can be modeled by FD-DEVS such that the player model has an input event ``?receive`` and an output event ``!send``. And it has two states: ``Send`` and ``Wait``. Once the player gets into ``Send``, it will generates ``!send`` and backs to ``Wait`` after the sending time which is 0.1 time unit. When staying at ``Wait`` and if it gets ``?receive``, it changes into ``Send`` again. In other words, the player model stays at ``Wait`` forever unless it gets ``?receive``.

To make a complete ping-pong match, one players starts as an offender whose initial state is ``Send`` and the other starts as an defender whose initial state is ``Wait``. Thus in Fig. 1. Player A is the initial offender and Player B is the initial defender. In addition, to make the game continue, each player's ``?send`` event should be coupled to the other player's ``?receive`` as shown in Fig. 1.

Two-Slot Toaster

Let's consider a toaster in which there are two slots that they have their own start knobs as shown in Fig. 2(a). Each slot has the identical functionality except their toasting time. Initially, the knob is not pushed, but if we push the knob, the associated slot starts toasting for its toasting time: 20 seconds for the left slot, 40 seconds for the right slot. After the toasting time, each slot and its knobs pop up. Notice that even though one tries to push a knob when its associated slot is toasting, nothing happens.

We can model it with FD-DEVS as shown in Fig. 2(b). Two slots are modeled as atomic FD-DEVS whose input event is ``?push`` and output event is ``!pop``, states are ``Idle`` (I) and ``Toast`` (T) with the initial state is ``idle``. When it is ``Idle`` and receives ``?push`` (because one pushes the knob), its state changes to ``Toast``. In other words, it stays at ``Idle`` forever unless it receives ``?push`` event. 20 (res. 40) seconds later the left (res. right) slot returns to ``Idle``.

Read more about this topic:  Finite & Deterministic Discrete Event System Specification

Famous quotes containing the word examples:

    It is hardly to be believed how spiritual reflections when mixed with a little physics can hold people’s attention and give them a livelier idea of God than do the often ill-applied examples of his wrath.
    —G.C. (Georg Christoph)

    No rules exist, and examples are simply life-savers answering the appeals of rules making vain attempts to exist.
    André Breton (1896–1966)

    In the examples that I here bring in of what I have [read], heard, done or said, I have refrained from daring to alter even the smallest and most indifferent circumstances. My conscience falsifies not an iota; for my knowledge I cannot answer.
    Michel de Montaigne (1533–1592)