Lecture 7: State Machines Flashcards
What is a state machine?
- Models the behaviour of an entity
- Specifies the state changes which an object performs triggered by states, events or transitions received by objects
How many state machines for an enity?
- Contains a single state machine for a single entity
- Specifies: the reaction from events
- The action from states
What is the Moore state machine?
- Moore machine uses **entry actions only **
- Output is produced when the state changes
What is a Mearly state machine?
• Mealy machine uses input actions only
- Output is produced based on the input state
What are the two different kinds of state machines?
• Behavioural – Defines the behaviour of a model element (the instance)
• Protocol - Model the protocol of a classifier
- Don’t have actions
What are the states of an object determind by?
- The values of its attributes
- The relationship to other objects
- The activities it is performing
What are the three elements of state machines?
- State
- Event
- Transition
What is a state?
a condition during the life of an object during which it satisfies some condition to perform an activity or wait for an event “Roundtangles”
What is an event?
An occurance that happens in a space and time
“Are written over the transition that they trigger”
What is a transition?
Is the movement from one state to another triggering an event
“Paths/link”
What are the four types of events?
- Call event
- Signal event
- Change event
- Time event
What does call event do?
Triggered by a synchronous operation call
What does a signal event do?
specifies communication of send request instances between objects.
Asynchronously between objects
- Receipt of a signalA signal is a classifier which
What does a change event do?
The constraint is a Boolean expression on the attributes of the objects either true/false is fullfilled
What does a time event do?
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