CS2002 - Week 9 - State Machine Diagrams Flashcards

(19 cards)

1
Q

What is the purpose of a state machine diagram?

A

To model:
- possible states of a system/object
- transitions between states triggered by events
- behaviour in each state.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What activities can occur within a state?

A

entry/Activity: runs on entering the state
exit/Activity: runs on exiting the state
do/Activity: runs while in the state.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What are the components of a transition?

A

Event (trigger)
Guard (boolean condition),
Effect (actions during transition).

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What is the difference between internal and external transitions?

A

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

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What are the types of events in a state machine?

A

Signal event (e.g. rightMouseDown)
Call event (e.g. register(exam))
Time event (e.g. after(5 secs)).

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What characterizes an initial state?

A

A pseudo-state with:
- no incoming edges
- immediate transition to next state
- guards on outgoing edges must be mutually exclusive.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What is the difference between a final state and a terminate node?

A

Final state: object remains here (end of lifecycle).
Terminate node: object is deleted.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What is a decision node?

A

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

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What is a parallelisation node?

A

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

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What is a synchronisation node?

A

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

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What is the difference between change events and guards?

A

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

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

How can you model a LectureHall state machine?

A

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

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What do states represent in a state machine?

A

Conditions or situations during the lifecycle of an object.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What do transitions represent?

A

The movement from one state to another, triggered by events, guards or activities.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

What are events in a state machine?

A

Triggers that cause a transition.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

What are guards in a state machine?

A

Boolean conditions that must be true for a transition to occur.

17
Q

What are activities in a state machine?

A

Actions executed when entering, exiting or during a state.

18
Q

When is a do-activity aborted?

A

When an event triggers a transition with no guard condition.

19
Q

What is a time event?

A

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