Upload
ken-johnson
View
3.086
Download
1
Embed Size (px)
DESCRIPTION
This slide set is a short presentation that helps give the idea of a finite state machine. The phone is an example of a finite state machine. It has state, and events transition it from one state to another.
Citation preview
The Phone
A simple example of a finite state machineKen Johnson
Waiting
The phone is idle and waiting for something to do
Waiting
Dialling
Event: Start calling
You start to phone someone
Waiting
Dialling Wait for answer
Event: Start calling
λ
You dial a number and start waiting for someone to answer the remote phone
Waiting
Dialling Wait for answer
Conversation
Event: Start calling
Event: Pick up
λ
Someone answers the remote phone and you talk to him (her)
Waiting
Dialling Wait for answer
Conversation
Event: Hang up
Event: Start calling
Event: Pick up
λ
You finish your conversation and hang up
Waiting
Dialling Wait for answer
Conversation
Event: Hang up
Time out
Event: Start calling
Event: Pick up
λ
If nobody answers the remote phone, you hang up and the phone becomes idle again
Waiting
Ringing
Dialling Wait for answer
Conversation
Event: Hang up
Time out
Event: Incoming call
Event: Start calling
Event: Pick up
λ
If there is an incoming call then the phone starts to ring
Waiting
Ringing
Dialling
Conversation
Wait for answer
Conversation
Event: Hang up
Time out
Event: Answered
Event: Incoming call
Event: Start calling
Event: Pick up
λ
If you answer the phone then you can talk to the remote person
Waiting
Ringing
Dialling
Conversation
Wait for answer
Conversation
Event: Hang up
Time out
Event: Answered
Event: Incoming call
Event: Start calling
Event: Pick up
Event: Hang up
λ
You hang up when you finish talking and the phone becomes idle again
Waiting
Ringing
Dialling
Conversation
Wait for answer
Conversation
Event: Hang up
Time out
Event: Answered
Event: Incoming call
Event: Start calling
Event: Pick up
Event: Hang up
λ
If nobody answers a ringing phone it will go back into an idle state
Time out