Lecture 7: State Machines Flashcards

1
Q

What is a state machine?

A
  • Models the behaviour of an entity
  • Specifies the state changes which an object performs triggered by states, events or transitions received by objects
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

How many state machines for an enity?

A
  • Contains a single state machine for a single entity
  • Specifies: the reaction from events
  • The action from states
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What is the Moore state machine?

A
  • Moore machine uses **entry actions only **
  • Output is produced when the state changes
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What is a Mearly state machine?

A

• Mealy machine uses input actions only

  • Output is produced based on the input state
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What are the two different kinds of state machines?

A

Behavioural – Defines the behaviour of a model element (the instance)
Protocol - Model the protocol of a classifier
- Don’t have actions

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

What are the states of an object determind by?

A
  • The values of its attributes
  • The relationship to other objects
  • The activities it is performing
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What are the three elements of state machines?

A
  • State
  • Event
  • Transition
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What is a state?

A

a condition during the life of an object during which it satisfies some condition to perform an activity or wait for an event “Roundtangles”

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

What is an event?

A

An occurance that happens in a space and time

“Are written over the transition that they trigger”

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

What is a transition?

A

Is the movement from one state to another triggering an event

“Paths/link”

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

What are the four types of events?

A
  1. Call event
  2. Signal event
  3. Change event
  4. Time event
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What does call event do?

A

Triggered by a synchronous operation call

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

What does a signal event do?

A

specifies communication of send request instances between objects.

Asynchronously between objects

  • Receipt of a signalA signal is a classifier which
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What does a change event do?

A

The constraint is a Boolean expression on the attributes of the objects either true/false is fullfilled

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

What does a time event do?

A

Time events occur when a time expression becomes true using the two key words: after and when

  • *After**: after time period
  • *When**: Some time condition becomes true

Specifies a particular time at which the event is triggered

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

The events can be appear what?

A
  • Can appear synchronously/asynchronously
  • Cause transitions between states
17
Q

What does synchronously do?

A

Synchronous calls, which are associated with an operation, have a send and receive message

  • Call event triggered by call
  • Exception even triggered by an object
18
Q

What does asynchronously do (list the events)?

A

When a signal is interrupted by a error condition and there are no operation with the signal

Signal event: signal sent by an object

  • Change event: triggered by side effects on object attributes
  • Time event: triggered by Boolean guard over time
19
Q

What is the syntax for transisiton?

A
  • Event: triggers transition
  • Guard condition: Boolean condition must be true before the transition occurs
  • Junction pseudo code: Transition merges in a branch
  • Choice pseudo-state: ~flows through the state according to its conditions
20
Q

What are the two special actions?

A

Entry and Exit

21
Q

When the transition has no event what’s the condition?

A

If transition has no event - automatic transition if the guard condition or precondition is true.