cs cpe 426 senior projects
Download
Skip this Video
Download Presentation
CS/CPE 426 Senior Projects

Loading in 2 Seconds...

play fullscreen
1 / 29

Chapter 21: State Machines Chapter 22:Advanced State Machines [Arlow and Neustadt 2005] March 4, 2008 - PowerPoint PPT Presentation


  • 264 Views
  • Uploaded on

CS/CPE 426 Senior Projects. Chapter 21: State Machines Chapter 22:Advanced State Machines [Arlow and Neustadt 2005] March 4, 2008. Outline. State machines: Introduction State machine diagrams States Transitions Events Advanced state machines: Composite states Simple Orthogonal

loader
I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.
capcha
Download Presentation

PowerPoint Slideshow about 'Chapter 21: State Machines Chapter 22:Advanced State Machines [Arlow and Neustadt 2005] March 4, 2008 ' - daniel_millan


An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript
cs cpe 426 senior projects
CS/CPE 426Senior Projects

Chapter 21: State Machines

Chapter 22:Advanced State Machines

[Arlow and Neustadt 2005]

March 4, 2008

outline
Outline
  • State machines:
    • Introduction
    • State machine diagrams
    • States
    • Transitions
    • Events
  • Advanced state machines:
    • Composite states
      • Simple
      • Orthogonal
    • Submachine states
    • Submachine communication
    • History
introduction
Introduction
  • Both activity diagrams and state machine diagrams model system behavior
  • However, they have different semantics:
    • Activity diagrams are based on Petri Nets and usually model processes when several objects participate
    • State machine are based on Harel’s statecharts and typically used to model single reactive objects
introduction1
Introduction
  • Reactive objects:
    • Respond to external events
    • May generate and respond to internal events
    • Have a lifecycle modeled as a progression of states, transitions and events
    • May have current behavior that depends on past behavior
  • State machines are used to model behavior of classifiers such as classes, use cases, subsystems, systems
introduction2
Introduction
  • There are two types of state machines:
    • Behavioral state machines
    • Protocol state machines
  • State machines are most commonly used to model dynamic behavior of classes
  • In UP, state machines can be used in: requirements, analysis, design
  • A significant challenge is testing state machines: manual walkthrough, simulation, code generation + test harnesses for state machines
state machine diagrams
State machine diagrams
  • There are three main modeling elements in state diagrams: statestransitions, and events.
  • Example of a simple state machine, Fig. 21.2 [Arlow & Neustadt]
states
States

Summary of UML state syntax, Fig.21.4 [Arlow & Neustadt 2005]

transitions
Transitions

Summary of UML syntax for transitions in behavioral state diagrams,

Fig.21.5 [Arlow & Neustadt 2005]

Where:

  • event(s)= internal or external occurrence(s) that trigger the transition
  • guardCondition = boolean expression, when true the transition is allowed
  • anAction = some operation that takes place when the transition fires
transitions1
Transitions

Summary of UML syntax for transitions in protocol state

diagrams, Fig.21.6 [Arlow & Neustadt 2005]

Note that there is no action and guard conditions are

replaced by preconditions and postconditions.

transitions2
Transitions

A junction pseudo-state represents a point where transitions merge or

branch, e.g. Fig.21.7 [Arlow & Neustadt 2005]

transitions3
Transitions

A junction pseudo-state may have more than one output transition

(protected by mutually exclusive guard conditions) e.g. Fig.21.8

[Arlow & Neustadt 2005]

transitions4
Transitions

Choice pseudo-state can also be used, e.g. Fig. 21.9 [Arlow & Neustadt

2005]

events
Events
  • Events can be of four types:
    • Call event
    • Signal event
    • Change event
    • Time event
events1
Events

Example of a call event, Fig.21.11 [Arlow & Neustadt 2005]

events2
Events

A signal is a package of

information sent

asynchronously between

objects. Example of signal

event Fig. 21.12 [Arlow &

Neustadt 2005]

Example of sending a

Signal Fig. 21.13 [Arlow &

Neustadt 2005]

events3
Events

Change events are positive edge triggered.

Example of a change event, Fig. 21.15 [Arlow & Neustadt 2005]

events4
Events

Time events are indicated by the keywords when and after.

Example of a time event, Fig. 21.16 [Arlow & Neustadt, 2002]

slide18
Example of a

state machine

[Dascalu 2001]

composite states
Composite states
  • A composite state contains one or more nested state machines (submachines), each existing in its own region, Fig 22.2 [Arlow & Neustadt 2005].
  • The composition icon is shown in Fig. 22.4
simple composite states
Simple composite states
  • A superstate that contains a single region is called a simple composite state, e.g.Fig 22.5 [Arlow & Neustadt 2005]
orthogonal composite states
Orthogonal composite states
  • Orthogonal composite states consist of two or more sub-machines that execute in parallel. InFig 22.6 [Arlow & Neustadt 2005] there are two such composite states, Initializing and Monitoring
orthogonal composite states1
Orthogonal composite states

The composite state Initializing, Fig 22.7 [Arlow & Neustadt 2005]

orthogonal composite states2
Orthogonal composite states

The composite state Monitoring,Fig 22.8 [Arlow & Neustadt 2008]

submachine states
Submachine states
  • A submachine state is a special state that references a state machine recorded in a separate diagram, e.g. Fig. 22. 9 [Arlow and Neustadt 2005]
submachine states1
Submachine states
  • Fig. 22. 10 [Arlow & Neustadt 2005]. The notation for a submachine state is

<state name : name of referenced state machine diagram>

submachine communication
Submachine communication
  • Asynchronous submachine communication can be achieved via attributes:
      • The modeled reactive object has a set of attributes that can be used by submachines
      • The communication mechanism: one machine sets attributes and the other uses the attribute values in guard conditions of their transitions
submachine communication1
Submachine communication
  • Example of communication via attributes, Fig. 22.11 [A&N 2005]
history
History

Example of using the shallow history indicator,Fig 22.12 [Arlow & Neustadt 2005]

history1
History

Example of using

the deep history

indicator

Fig 22.13 [Arlow &

Neustadt 2005]

ad