Finite State Machines ENGR 110 #7 2016

Slides:



Advertisements
Similar presentations
F27SB2 Software Development 2 Lecture 1: Introduction.
Advertisements

Chapter 11 Designing the User Interface
Modeling Computation Chapter 13.
IGCSE ICT Control Systems.
In this presentation you will:
Finite state machines.
THE OBJECT-ORIENTED DESIGN WORKFLOW Statechart Diagrams.
7. 2Object-Oriented Analysis and Design with the Unified Process Objectives  Detailed Object-Oriented Requirements Definitions  System Processes—A Use.
Russell Taylor Lecturer in Computing & Business Studies.
Software engineering Olli Alm Lecture 2: requirements, modelling & representation.
©Ian Sommerville 2004Software Engineering, 7th edition. Chapter 16 Slide 1 User interface design.
02/06/05 “Investigating a Finite–State Machine Notation for Discrete–Event Systems” Nikolay Stoimenov.
CS 0004 –Lecture 1 Wednesday, Jan 5 th, 2011 Roxana Gheorghiu.
The New Computing Curriculum select, use and combine a variety of software (including internet services) on a range of digital devices to design and create.
CS4730 Real-Time Systems and Modeling Fall 2010 José M. Garrido Department of Computer Science & Information Systems Kennesaw State University.
Lecture 10: 8/6/1435 Machine Learning Lecturer/ Kawther Abas 363CS – Artificial Intelligence.
1 Modeling interactions and behavior Lecturer Dr. Mai Fadel.
What is Computer Science? “Computer Science is no more about computers than astronomy is about telescopes.” - Edsger Dijkstra “Computer Science is no more.
Computer Control.
Data Structures and Algorithms Dr. Tehseen Zia Assistant Professor Dept. Computer Science and IT University of Sargodha Lecture 1.
CS1Q Computer Systems Lecture 11 Simon Gay. Lecture 11CS1Q Computer Systems - Simon Gay 2 The D FlipFlop The RS flipflop stores one bit of information.
CS4730 Real-Time Systems and Modeling Fall 2010 José M. Garrido Department of Computer Science & Information Systems Kennesaw State University.
Higher Vision, language and movement. Strong AI Is the belief that AI will eventually lead to the development of an autonomous intelligent machine. Some.
SOFTWARE DESIGN AND ARCHITECTURE LECTURE 26. Review UML behavioral Diagrams – Sequence diagram.
Dr Nick Mitchell (Room CM 224)
Computer-based Media Language Elements Understanding how we communicate through media Stewart.C. (2007). Media: New Ways and Means. John Wiley & Sons:

Finite State Machines 1.Finite state machines with output 2.Finite state machines with no output 3.DFA 4.NDFA.
HOW THEY WORK AND WHAT THEY DO. Jay Jay 9S. A control program is a type of programming that allows you to control systems. Control programs are used in.
Brief Introduction to the Concept of Form vs Function in Design Design 11.
Theory of Computation Automata Theory Dr. Ayman Srour.
Game & Graphics Engines Tyler Hollingsworth. The Difference A game engine is a software system designed for the creation and development of video games.
Hardware and Software 6 th Grade Advanced Robotics 2.
Design Communication. Freehand Drawing Definition: The spontaneous representation of ideas on paper without the use of technical aids.
Application architectures. Objectives l To explain the organisation of two fundamental models of business systems - batch processing and transaction processing.
UML for design: Class Diagrams ENGR 110 #
Information Retrieval in Practice
Chapter 15 Recording and Editing Sound
CompSci 280 S Introduction to Software Development
GCSE COMPUTER SCIENCE Computers
VEX IQ Curriculum Smart Machines Lesson 09 Lesson Materials:
Chapter 5 System modeling
AS Computer Studies Finite State Machines 1.
1.3 Finite State Machines.
More kinds of FSM ENGR 110 #
Software Mr. Singh.
Finite State Machines Dr K R Bond 2009
Topic: Introduction to Computing Science and Programming + Algorithm
Introduction to Event-Driven Programming
Chapter 5: MACHINATIONS
How People with Disabilities Access the Web
Graph Coverage for Specifications CS 4501 / 6501 Software Testing
Chapter 5 – System Modeling
Understanding an App’s Architecture
FSM Controllers ENGR 110 #
Introduction to robotics
Evaluation in Engineering Design Process Modeling and FSM
Control (programming)
Patterns.
Informatics 121 Software Design I
Design and Implementation
CS310 Software Engineering Dr.Doaa Sami
Software testing and configuration : Embedded software testing
Algorithm and Ambiguity
Computer Basics.
Remarks on Software Design
Lecture One: Automata Theory Amjad Ali
ECE 352 Digital System Fundamentals
HUMAN COMPUTER INTERACTION. The main aims of the chapter are to: Explain the difference between good and poor interaction design. Describe what interaction.
From Use Cases to Implementation
Presentation transcript:

Finite State Machines ENGR 110 #7 2016

Menu Designing a controller for traffic lights. What is a Finite State Machine? Finite State Machines for controllers. Announcements:

Traffic Lights Traffic lights at Salamanca Rd/The Terrace They are annoying! How should they work? Simple – only a three way intersection Write down a design.

Finite State Machine What are FSM's? A way of thinking about certain kinds of problems A way of describing/modeling/analysing systems A way of designing solutions to a wide range of engineering problems. Example applications Models of physical devices Controllers for physical devices Controllers for NPCs in computer games Protocols for communications/networking Regular expression searching in text Analysing and Designing user interfaces. Speech recognition ….

States and Transitions Key idea: If a system has finite set of possible states, then you can list them, and identify each of the possible things that could happen in each state. Typically: draw labelled circles for the states draw labelled arrows for the transitions between them transition1 transition3 State1 State2 transition2

States and Transitions Eg: modelling a Door: Possible states: open, closed Possible transitions: push, pull (Take system from one state to another ). , closed&Locked , turn key or back to same state) push turn key push pull push open closed closed & locked turn key pull pull turn key

States and Transitions Eg: an ecommerce website: states: the series of pages in the purchase sequence transitions: the buttons: buy now, next, back, confirm, back to cart Useful model when first designing the web pages. Cart back to cart back to cart back to cart buy now next next confirm Address Details Payment Details Confirm- ation Receipt back back

Abstraction Typically, a Finite State Machine is an abstraction: Simplification Capturing the significant aspects of the behaviour Leaving out unimportant details Describes the system at a particular level. eg: the door: how far open the door is, how big the door is, what kind of key it uses how hard you have to push to close it. …. eg the website no details of the actions on each page

Kinds of Finite State Machines. Lots of different varieties of Finite State Machines. Describing how a passive system works. states the system can be in, actions on the system that change its state. eg: the door, the website, a DVD player, Can use the FSM description to Design the system Explain the system to users Construct a simulation of the system …. open closed & locked pull push turn key turn key

Kinds of Finite State Machines. Describing/specifying an active system states the system can be in input/signals/sensors that the system may respond to actions that the system will perform eg: an autonomous vehicle with sensors a controller for a robotic toy an NPC in a video game a controller for a lift (the assignment) … begging patted start begging stop stop timer timer walking waiting turning round patted IR sensor start walk, start timer(30) start turning, start timer(10)

Kinds of Finite State Machines. Specifying a pattern or a language states representing different points in the pattern characters/words/signals that are the next component of the pattern eg: Regular expression matching in an editor (SW|NW|EC)EN3[0-9][0-9] Sequence of the sounds for different phonemes in a word Simple command language for an adventure game. (Fundamental to some algorithms for text and language.) Specifying a communication protocol states representing different stages in the communication message types that are expected or required at each stage

? Controllers Devices to control systems. Controller Could be hardware, but usually software, might be a microprocessor or a large computer. Controller gets input from the system Controller performs actions on the system to change its behaviour Note: two different systems here: controller and the controlled system. Might need to design both, but they are separate issues. System: robotic toy autonomous vehicle lift traffic lights vending machine animation of NPC etc. Controller ? Signals/sensors actions

Simple Reactive Controllers. Controller drives the system: Input: Signal/sensor value from the system triggers an action Output: Action, reacts to the signal Same response to a sensor, every time Very limited System: robotic toy autonomous vehicle lift traffic lights vending machine animation of NPC etc. Signals/sensor values Controller Signal1 ⇒ action1 Signal2 ⇒ action2 Signal3 ⇒ action3 Signal4 ⇒ action4 actions

FSM Controllers. Controller drives the system: System: Controller Input Signal/sensor from the system triggers an action and changes state (of the controller) States represent the history of what has gone before to enable different responses to same sensor at different times Much richer behaviour. System: robotic toy autonomous vehicle lift traffic lights vending machine animation of NPC etc. Signals/sensors Controller sensor action actions

Example: Traffic light controller Signals/sensor values? Actions? States? what are the different conditions where the controller should act differently? eg: should it always change the lights when a car drives up?

States for traffic light controller