Download presentation
Presentation is loading. Please wait.
1
Advanced State Chart diagrams
State Machines Advanced State Chart diagrams SE-2030 Dr. Mark L. Hornick
2
State Diagrams can be used to help specify the dynamic logic implemented in Controller objects in response to events that the Controller receives SE-2030 Dr. Mark L. Hornick
3
Review: A simple state diagram illustrating a transition between two states.
<event>: the trigger that causes the transition from State1 to State2 <guard>: a condition that must be satisfied for the transition to be permitted <effect>: the behavior or activity that takes place as part of the transition Q1: When does the effect take place? Q2: What state is the system in at the time of the effect? SE-2030 Dr. Mark L. Hornick
4
A state may specify actions that occur upon entry and exit
entry/<action>: the operation to perform upon entering this state exit/<action>: the operation to perform upon exiting this state Entry/exit actions can be used to effectively “clean up” diagrams where multiple transitions into or out of a state have the same effect. SE-2030 Dr. Mark L. Hornick
5
A state may also specify an ongoing action that takes place while in the state
do/<action>: the operation to perform while in this state SE-2030 Dr. Mark L. Hornick
6
A state may have attributes
SE-2030 Dr. Mark L. Hornick
7
Sometimes a single state can be entered from multiple other states, leading to a proliferation of state transitions SE-2030 Dr. Mark L. Hornick
8
The “join” feature is one way to clean some of this up…
SE-2030 Dr. Mark L. Hornick
9
Conversely, a state transition can be forked into several states
Note that we lose the deterministic characteristics here since it is not clear which state is entered after existing the Paused state. SE-2030 Dr. Mark L. Hornick
10
Composite states are comprised of sub-states
The semantics of a Composite state imply that the system must be in only one of the sub-states at any given time. SE-2030 Dr. Mark L. Hornick
11
This allows us to reduce the number of state transitions
This notation indicates that the Paused state can be reached from any of the sub-states of the Running state. SE-2030 Dr. Mark L. Hornick
12
The History pseudo-state
The History pseudo-state indicates that, upon re-entry into the Running state, the last-remembered sub-state will be restored.. SE-2030 Dr. Mark L. Hornick
13
Default re-entry If the history is lost, this notation indicates that the default state upon re-entry will be the Washing state. SE-2030 Dr. Mark L. Hornick
14
Direct entry/exit from sub-states
This notation indicates that the Setup state transitions directly to the Washing sub-state, and the Spinning state transitions directly to the Clean final psuedo-state. SE-2030 Dr. Mark L. Hornick
15
Entry and exit points This notation indicates that the Setup state transitions to the Running state, and then to the Washing state via the RunningEntry pseudo-state. Similar for the exit to the Clean finish state. SE-2030 Dr. Mark L. Hornick
16
Concurrent independent states can also be accommodated
CS-1020 11/24/2018 Concurrent independent states can also be accommodated SE-2030 Dr. Mark L. Hornick Dr. Mark L. Hornick
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.