Presentation is loading. Please wait.

Presentation is loading. Please wait.

More kinds of FSM ENGR 110 #11 2016.

Similar presentations


Presentation on theme: "More kinds of FSM ENGR 110 #11 2016."— Presentation transcript:

1 More kinds of FSM ENGR #

2 Menu More kinds of Finite State Machines Announcements:
Test next Wednesday

3 FSMs for generating behaviour
Controllers respond to sensors/signals with actions Generators create behaviour May be non-deterministic – multiple possibilities from a state May have self transitions for staying in some state Action 1 Action 8 A B Action 2 Action 7 Action 3 Action 9 Action 4 C D Action 5 Action 6

4 FSMs for generating behaviour
Controllers respond to sensors/signals with actions Generators create behaviour May have probabilities on transitions May have self transitions for staying in some state May also have other input conditions on transitions Action 1 20% 80% Action 8 A 10% B 80% Action 2 50% Action 7 50% Action 3 10% Action 9 Action 4 30% 30% C D Action 5 40% 100% Action 6

5 FSM for modeling and design
Designing smart homes for energy saving: Want to turn devices on and off automatically to minimise energy maximise comfort. Want to detect (and predict) behaviour of the occupants and respond differently in different states. Did they leave the room/house for just a short time or will they be returning in 5 mins? Did they leave the stovetop on for a reason? How much hot water will they use in the next 6 hours? …. Need a model of what the occupants are likely to do, given as much information as you can detect from the house Needs to be probabilistic

6 Modeling How much will it save to have a smart home?
Need to run a simulation and measure it. Need a model of the occupants that will act like people in a simulated house. Want to build a generative model of people's behaviour: Cannot be deterministic – must account for variation. Needs probabilities and statistical distributions Building a NPC for a game: character should have a variety of different behaviours should respond to events by changing to different behaviours. may want some unpredictability/independence/initiative Eg, The Sims

7 Smart home occupant modeling
Need sensors, timings, and probabilities. Need actions Cleaning up after mins turn stove off turn up main room heating Eating dinner in living room Cooking in kitchen 20% Hot water in sink Stove on 75% 5% Arrive Home Watching TV Doing Laundry Unknown Having breakfast at 5:30-6:00 if temp<18 turn on heating Sleeping Gone to Work 50% Having shower 50% at 4am, turn on hot water turn off heating

8 NPC design 98% Win fight enemy approaches On Guard Fighting 0.1% 1.9%
Losing fight after 10 mins Patrolling Running away enemy approaches after 8 hrs Sleeping Near a hiding place Hiding after 20 mins 10

9 NPC design What is each state? Where are the actions?
FSM may be a high level design Each state specifies a complete behaviour set of rules for reacting procedures/code to run animation sequences FSM controls higher level of program conditions for switching to different behaviour

10 FSM for Modeling speech.
Standard approach for speech recognition: "Hidden Markov Models" Just a FSM model of speech sounds. sequence of frequency spectrums. Each "phoneme" represented by a three state probabilistic FSM: Each state specifies a probability distribution on the spectrum 98% 60% 70% 40% 30%

11 FSMs for Modeling Speech
Word is a sequence of phonemes Can use as a generator, or Match actual sound pattern to the predictions Variety of techniques for automatically learning models from data. P A T 60% 70% 40% 30% 60% 70% 40% 30% 60% 70% 40% 30%

12 FSM Acceptors Acceptors:
FSM just has input: sequence of input words/symbols Either accepts or rejects the sequence. A “traditional” use of FSM's in computer science. Describing little languages. Searching for patterns in text. "the" "a" "cat" "rat" "dog" "and" "ate" "chased" "cheese" "barked" "squeaked"

13 FSM Acceptors Searching for patterns in text. eg, searching for recent dates: "Regular Expressions" 9 9 8 8 7 7 6 6 5 5 4 4 3 3 3 2 2 2 1 1 1 1 / / 9 9 8 8 7 7 6 6 5 5 4 4 3 3 1 2 9 2 1 1 2 1

14 FSMs for language Lindsay eats breakfast (every day at 8am)
Lindsay was eating breakfast (yesterday at 7am) Lindsay will have been eating breakfast (for three hours when the timer goes off) Breakfast is being eaten (as we speak) Breakfast should be eaten (before lunchtime) Breakfast might be eating Lindsay! (if the grasshoppers haven’t been cooked properly) + tense (past or present) Will Did Do Does May Might Would Should + infinitive “Have” verb + past- participle (…ed/en) “Be” verb + present- participle (…ing) “Be” verb + past- participle (…ed/en) Main verb

15 FSMs for Network Protocols
FSMs are often used to specify protocols. Describes how each side responds to different messages Used for Understanding the protocol Specifying and checking the protocol Implementing the protocol. Note additional structure in this FSM: This is a FSM inside one state of a larger FSM!

16 FSMs for network protocols
DHCP protocol (Dynamic Host Configuration Protocol) Finite State Machine describing the client side of the process Diagram from: (large site explaining networking principles)


Download ppt "More kinds of FSM ENGR 110 #11 2016."

Similar presentations


Ads by Google