CS2002 - Week 9 - State Machine Diagrams

0.0(0)
studied byStudied by 0 people
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
Card Sorting

1/18

encourage image

There's no tags or description

Looks like no tags are added yet.

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced

No study sessions yet.

19 Terms

1
New cards

Purpose of a state machine diagram

To model:

- possible states of a system/object

- transitions between states triggered by events

- behaviour in each state

2
New cards

Activities within a state

entry/Activity: runs on entering the state

exit/Activity: runs on exiting the state

do/Activity: runs while in the state

3
New cards

Components of a transition

Event (trigger)

Guard (boolean condition)

Effect (actions during transition)

4
New cards

Internal vs External transitions

Internal: No state change (e.g. event1 triggers Activity3 in state1) External: State change (e.g. event1 moves from state1 to state2)

5
New cards

Types of events

Signal event (e.g. rightMouseDown)

Call event (e.g. register(exam))

Time event (e.g. after(5 secs))

6
New cards

Initial state

A pseudo-state with:

- no incoming edges

- immediate transition to next state

- guards on outgoing edges must be mutually exclusive

7
New cards

Final state vs Terminate node

Final state: object remains here (end of lifecycle)

Terminate node: object is deleted

8
New cards

Decision node

Splits transitions into alternative paths with guards (e.g. [x > 0])

9
New cards

Parallelisation node

Splits control flow into concurrent sub-flows (1 input -> N outputs)

10
New cards

Synchronisation node

Merges concurrent sub-flows into one (N inputs -> 1 output)

11
New cards

Change events vs Guards

Change event: continuously checked (e.g. when(x > y))

Guard: checked only when event occurs

12
New cards

Model a LectureHall

[Free] -(occupy)-> [Occupied] [Occupied] -(release)-> [Free]

13
New cards

States

Represents conditions or situations during the lifecycle of an object

14
New cards

Transitions

Represents the movement from one state to another, triggered by events, guards or activities

15
New cards

Events

Triggers that cause a transition

16
New cards

Guards

Boolean conditions that must be true from a transition to occur

17
New cards

Activities

Actions executed when entering, exiting or during a state

18
New cards

When is a do-activity aborted?

When an event triggers a transition with no guard condition

19
New cards

Time event

An event like when(date=31.12.2001) that triggers at a specific time