real time systems advanced state machines. behaviour (part 2) - 2 outline simple and composite...
TRANSCRIPT
Real Time Systems
Advanced State Machines
Behaviour (part 2) - 2
Outline
Simple and Composite States
Transition Segments and Junction Points
Run-to-Completion
Group Transitions and History
Self & Internal Transitions
Exercise
Behaviour (part 2) - 3
Simple and Composite States
compositesimple
external view
??
Behaviour (part 2) - 4
Simple and Composite States
internal view
What triggersthese transitions?
Behaviour (part 2) - 5
Transition Segments
transition segments => a transition chain single trigger
State?
Behaviour (part 2) - 6
Junction Points - 2 types
Termination (history)extension
Behaviour (part 2) - 7
Design Tip:Unnamed Transitions / Segments
Do not leave these “unnamed” transitions in your models!!!
Behaviour (part 2) - 8
Run-to Completion
a capsule exhibits run-to-completion semantics: meaning that a capsule will not be interrupted by
the run-time services library while it is executing a run-to-completion step.
when a message is received by a capsule, the entire transition chain executes (before another message is delivered);
data sent with a message is only accessible until the end of the run-to completion a local copy must be made to preserve the data
Behaviour (part 2) - 9
Run-to Completion
consider event “done” while in sub-state “paint”. what is the sequence of execution code?
“Workstation” state “producing” sub-state
Behaviour (part 2) - 10
Group Transitions
transitions from hierarchical states that are common to all sub-states example: “error” while in the sub-state “paint” what is the sequence of execution code?
Behaviour (part 2) - 11
History (*deep)
the deepest sub-state when the containing state was last active. example: “reset” what is the sequence of execution code ?
Behaviour (part 2) - 12
Self-transition
a transition “out-of” and “back-into” a state what are the consequences of getting a status
message while in the “paint” sub-state?
Behaviour (part 2) - 13
Internal-transition
a self-transition which never exits the state does not fire all entry / exit code up & down the
state hierarchy; example: the new “status” transition
Behaviour (part 2) - 14
Behaviour Exercise – part 1
Go to the RoseRT on-line Help Complete the animated Concept Tutorial
entitled: Capsule Hierarchical State Machines
{if you have not already done so}
Behaviour (part 2) - 15
Behaviour Exercise – part 2
Refer to the following 2 state diagrams: Television Satellite Receiver – Top State Television Satellite Receiver – Operate Sub-state
Assume that initially you are in the Locked sub-state. After that follow the state machine wherever the transition chains take you: doDiagnostics followed by changeChannel followed by orderMovie followed by status followed by diag_timeout signal;
assume EvaluateTest = false
Behaviour (part 2) - 16
Television Satellite Receiver – Top State
changeChannel,
Behaviour (part 2) - 17
Television Satellite Receiver – Operate Sub-state