State Machines State diagrams SE-2030 Dr. Mark L. Hornick 1.

Slides:



Advertisements
Similar presentations
State Diagram 1. State diagram: Shows the behavior of one object. They describe all of the possible states that a particular object can get into and how.
Advertisements

UML State Machine Diagrams and Modeling
1 © 2014 B. Wilkinson Modification date: Dec Sequential Logic Circuits – I Flip-Flops A sequential circuit is a logic components whose outputs.
FLOWCHART BASED DESIGN A flowchart is ideal for a process that has sequential process steps. The steps will be executed in a simple order that may change.
SE-2840 Dr. Mark L. Hornick 1 HTML input elements and forms.
State Diagram. What is State Diagram?  State diagram is used to show the state space of a given class, the events that cause a transition from one state.
THE OBJECT-ORIENTED DESIGN WORKFLOW Statechart Diagrams.
UML Sequence Diagrams Eileen Kraemer CSE 335 Michigan State University.
UML Sequence Diagrams Michael L. Collard, Ph.D. Department of Computer Science Kent State University.
Slide - 1 Dr Terry Hinton 6/9/05UniS - Based on Slides by Micro Analysis & Design An example of a Simulation Simulation of a bank: Three tasks or processes:
CS451 Introduction to Software Engineering Behavioral Modeling.
State Machines State diagrams SE-2030 Dr. Rob Hasker 1 Based on slides written by Dr. Mark L. Hornick Used with permission.
CS 325: Software Engineering February 26, 2015 Object-State Modeling for Event-Driven Systems Event-Driven Systems UML State Machine Diagrams State Pattern.
State Machine Diagram Chapter 10. State Machine Diagram Used to describe system behavior.
Chapter 10 State Machine Diagrams
Software Engineering 1 Object-oriented Analysis and Design Chap 29 UML State Machine Diagrams and Modeling.
Guide to State Transition Diagram. 2 Contents  What is state transition diagram?  When is state transition diagram used?  What are state transition.
Software Transition Testing Presented By: Varun Phanda
Control Technology and Automation
Object-Oriented Modeling Using UML CS 3331 Section 2.3 of Jia 2003.
1 Modeling interactions and behavior Lecturer Dr. Mai Fadel.
Implementing software in IEC Languages in IEC IEC uses the following languages Instruction List – Assembly level programming using.
The Unified Modeling Language Part II Omar Meqdadi SE 2730 Lecture 9 Department of Computer Science and Software Engineering University of Wisconsin-Platteville.
Example: object diagram for Scheduler, v What is wrong with this diagram? Seems like a lot of similarity between Task and UnplannedTask Can use.
Class and Sequence diagrams UML notation SE-2030 Dr. Mark L. Hornick 1.
1 Kyung Hee University Statecharts Spring Kyung Hee University Specifying Objects’ Behaviour  Interaction diagrams show message-passing behaviour.
Chapter 29 State Machine Diagrams 1CS6359 Fall 2011 John Cole.
CS-1020 Dr. Mark L. Hornick 1 Event-Driven Programming.
CSCI-383 Object-Oriented Programming & Design Lecture 12.
Design a Circuit. Circuits The bulb will only light if there is a battery and a complete circuit.
Use Case Textual Analysis
States.
Dr. Hoganson CSIS 4381 Finite State Recognizer In this project, we will use the MicroStamp to function as a Finite State Recognizer (FSR). A FSR is a type.
SOFTWARE DESIGN AND ARCHITECTURE LECTURE 26. Review UML behavioral Diagrams – Sequence diagram.
UML Class Diagram notation Indicating relationships between classes SE-2030 Dr. Mark L. Hornick 1.
Electric Circuits. ► All electrical devices have an electric circuit, also known as a path for electrons to flow. ► All circuits have at least four parts:
Practical Object-Oriented Design with UML 2e Slide 1/1 ©The McGraw-Hill Companies, 2004 PRACTICAL OBJECT-ORIENTED DESIGN WITH UML 2e Chapter 10: Statecharts.
MCS 270 Spring 2014 Object-Oriented Software Development.
Synchronous Counter Design
AND Gate Inputs Output Input A (Switch) Input B (Switch) Output Y (Lamp) 0 (Open) 0 (OFF) A B Lamp.
Lamp Housing Light Bulb Condensers Negative Carrier Bellows Lens Directions: Name each part Shown in the Diagram, starting At label “A”
Activity Diagramming by Andrzej Rosolski Stanisław Gliniewicz.
Model-View-Controller A Design Pattern SE-2030 Dr. Rob Hasker 1 Based on slides written by Dr. Mark L. Hornick Used with permission.
High Level Design Use Case Textual Analysis SE-2030 Dr. Mark L. Hornick 1.
The Command Pattern SE-2811 Dr. Mark L. Hornick 1.
PLC programming Part 3: Problems with solutions. Topics  Every problem is devided into three parts:  Technology description contains the general properties.
PHYSICS – Digital electronics. LEARNING OBJECTIVES Core Supplement Explain and use the terms analogue and digital in terms of continuous variation and.
® IBM Software Group © 2009 IBM Corporation Module 11: Creating State Machine Diagrams Essentials of Modeling with IBM Rational Software Architect V7.5.
State Machine Diagrams
Finite State Machines Dr K R Bond 2009
Image Formation Preliminary Physics.
7. State Diagram SWE SOFTWARE PROCESS MODELING - AMAN QUADRI.
State Machine Diagrams
Evaluation in Engineering Design Process Modeling and FSM
Model-View-Controller
States.
Object Oriented System Design
All very logical I think!
Advanced State Chart diagrams
State Diagrams.
Chapter 5 state Modeling
Sequential Systems with Random Inputs
Windowing Push-Pull Systems
States.
UML State Diagrams.
ECE 352 Digital System Fundamentals
Modeling Behavior in Statechart Diagrams
State-Transition Diagrams
UML State Diagrams (Ch. 29)
Chapter 4 Sequence Diagrams
Presentation transcript:

State Machines State diagrams SE-2030 Dr. Mark L. Hornick 1

SE-280 Dr. Mark L. Hornick 2 The State Diagram can be a powerful aid in helping you to define the operation of a Controller State Diagrams illustrate the dynamic behavior of a system (i.e. how a Controller functions) where events (perhaps from the UI) trigger one or more actions and cause the system (Controller) to change its state.

A traffic light controller changes states based on events from a timer that fires at regular intervals SE-2030 Dr. Mark L. Hornick 3

Winter 2005/2006SE-280 Dr. Mark L. Hornick 4 A guard may be used to illustrate a condition that must be satisfied before a state transition can occur. The guard appears in brackets: [ ]

A State Diagram for a light bulb controlled with a toggle switch SE-2030 Dr. Mark L. Hornick 5 The event flip switch to ‘1’ triggers the action current flows and the transition to the on state. The event flip switch to ‘0’ triggers the action current stops flowing and the transition to the off state.

A State Diagram for a light bulb controlled with a pushbutton switch SE-2030 Dr. Mark L. Hornick 6 The same event (button pressed) triggers different actions depending upon its current state.

Different events may also cause transitions to the same state SE-2030 Dr. Mark L. Hornick 7 Different events may cause transitions to different states However, state transitions must be deterministic; that is, the same event cannot cause a transition from one given state to more than one subsequent state.

The same event can cause different states to transition to the same state SE-2030 Dr. Mark L. Hornick 8 These state transitions are still deterministic since the same event does not cause a transition from one given state to more than one subsequent state.

It is common for an event to result in an action, but no state transition SE-2030 Dr. Mark L. Hornick 9

In a complex system, different events may cause transitions to different states or to the same state SE-2030 Dr. Mark L. Hornick 10

Initial and Final states may be indicated as follows SE-2030 Dr. Mark L. Hornick 11 Initial and Final states are special in that once a system leaves an Initial state, it cannot return to that state, and once a system achieves a Final state, it stays in that state.

Demo: Describe the logic in a 2-button lamp controller via a state diagram, and implement the controller as a State Machine SE-2030 Dr. Mark L. Hornick 12