SYST611 Week 5 - Extended State Machines
SYST611 Week 5 - Extended State Machines
Abbas K. Zaidi
Outline
ExtendedSM - 2
ESM - 1
Discrete Event Systems
ExtendedSM - 3
An Informal Review
ExtendedSM - 4
ESM - 2
Finite State Machines with
Output
ExtendedSM - 5
Transition Diagram
Input/output
ExtendedSM - 6
ESM - 3
Transition Diagram
Input
output
ExtendedSM - 7
© AKZ v. 1.0
2/18/2020 ExtendedSM - 8
ESM - 4
Demonstration – Moore Machine
© AKZ v. 1.0
2/18/2020 ExtendedSM - 9
Consider a system that counts the number of cars that enter and leave a parking
garage in order to keep track of how many cars are in the garage at any time. We
ignore the sensors that detect the entry or departure of cars. We simply assume
that the ArrivalDetector actor produces an event when a car arrives, and the
DepartureDetector actor produces an event when a car departs. The Counter
actor keeps a running count, starting from an initial value i. Each time the count
changes, it produces an output event that updates a display.
ExtendedSM - 10
ESM - 5
Garage Counter: Moore Machine
ExtendedSM - 11
ExtendedSM - 12
ESM - 6
Mealy and Moore
Equivalence
• Any Moore machine may be converted to an equivalent Mealy
machine.
• A Mealy machine may be converted to an almost equivalent Moore
machine that differs only in that the output is produced on the next
reaction rather than on the current one.
• Mealy machines are more compact (requiring fewer states to
represent the same functionality)
ExtendedSM - 13
• The State Machine of Garage Counter will become very large with M.
That is the reason for using the informal notation of ‘…’ on the
transition diagrams.
• An extended state machine solves this problem by augmenting the
FSM model with variables that may be read and written as part of
taking a transition between states.
Extended FSM of
Garage Counter Example
ExtendedSM - 14
ESM - 7
General Notation of ESM
• The state of an extended state machine includes the information about the
state node and the values of the variable(s).
• The number of possible states can be quite large, or even infinite.
ExtendedSM - 15
Timed Automata
ExtendedSM - 16
ESM - 8
Example: Traffic Light Controller at a
Pedestrian Crossing
ExtendedSM - 17
• Non-deterministic ESM
(States, Inputs, Output, possibleUpdates, initialStates)
Uses of Non-determinism
• Environment Modeling: hide irrelevant details about how an
environment operates, resulting in a non-deterministic FSM.
• Specifications: System specifications impose requirements on some
system features, while leaving other features unconstrained.
Note:
The nondeterministic FSM makes no statement about how likely the
various reactions are. A model that specifies likelihoods (in the form of
probabilities) is a stochastic model, distinct from a nondeterministic
model.
ExtendedSM - 18
ESM - 9
Other Topics of Interest in ESM
Composition
• Side-by-side Composition
M1
M2
• Cascade Composition
M1 M2
• Feedback Composition M1
ExtendedSM - 19
• Side-by-Side
– Synchronous
– Asynchronous
ExtendedSM - 20
ESM - 10
Synchronous Composition
ExtendedSM - 21
Asynchronous Composition
• One Definition
ExtendedSM - 22
ESM - 11
Composition
• Cascade Composition
ExtendedSM - 23
Cascade Composition
• Example – B: Model of a Traffic Light
– A: Model of a Pedestrian Controller at a Pedestrian
Crossing Light Crossing
ExtendedSM - 24
ESM - 12
Cascade Composition
ExtendedSM - 25
Cascade Composition
ExtendedSM - 26
ESM - 13
Demonstration – Stateflow
Toolbox, Simulink
© AKZ v. 1.0
2/18/2020 ExtendedSM - 27
Demonstration – Stateflow
Toolbox, Simulink
© AKZ v. 1.0
2/18/2020 Examples from The MathWorks (http://www.mathworks.com/) ExtendedSM - 28
ESM - 14
Demonstration – Stateflow
Toolbox. Simulink
© AKZ v. 1.0
2/18/2020 Examples from The MathWorks (http://www.mathworks.com/) ExtendedSM - 29
Demonstration – Stateflow
Toolbox, Simulink
© AKZ v. 1.0
2/18/2020 ExtendedSM - 30
ESM - 15
DEVS
(Zeigler, 1976)
ExtendedSM - 31
Definition*
ExtendedSM - 32
* http://www.acims.arizona.edu/EDUCATION/ECE575Fall03/Note/
ESM - 16
Basic Concepts*
ExtendedSM - 33
* http://www.acims.arizona.edu/EDUCATION/ECE575Fall03/Note/
DEVS Tools
• Tools Developed at ACIMS, Univ. of Arizona:
– ADEVS
– DEVSJAVA
– DEVS/CORBA
– DEVS/Grid
– DEVS/P2P
– DEVS/SOA
– DEVS/HLA
– DEVS/RMI
• CD++ (Carleton Univ.)
• GALATEA (USB – Venezuela)
• GDEVS (Aix-Marseille III, France)
• JDEVS (Universite de Corse – France)
• PyDEVS (McGill)
• SimBeams (Univ of Linz – Austria)
ExtendedSM - 34
ESM - 17
Applications
ExtendedSM - 35
Applications
ExtendedSM - 36
ESM - 18
References
ExtendedSM - 37
DEVS Resources
ExtendedSM - 38
ESM - 19