Module 10- State Machine Part 2 Flashcards
difference between events and behaviors
- an event occurs at a discrete moment in time ** has no duration**
- a behavior has duration
relationship between them
- when an event occurs it may trigger the event of a behavior then that executes over a period of time
and while a behavior executes it may ______________
generate new event occurrences that might kick off more behaviors
Four kinds of events
- signal event
- call event
- change event … keyword “when”
- time _____
time event
and how they can be used as triggers in transitions ??
at - absolute time event
after - discrete time event after 2mins
review from activity diagram .. accept event action . This waits for an event to occur in the event pool. Then it consumes the event and moves on to the next step.
an accept event action could have any event as a trigger
signal , call , _________or time event
change
signal event- reception - signal
call change event- operation - parameter list
big idea .. the signal event … call event .. change event … or time events can be used as a _____ on transitions in a state machine
trigger
a signal event trigger corresponds to a ____
reception
the reception is owned by the block that owns that state machine behavior
signal event trigger matches the reception owned by the block that _________
owns that state machine behavior
problem is the STM doesn’t show the owning block you would have to dig into the model . Solution - go into the block that owns that state machine behavior.. double check if that block owns that reception .. which receptions owns signals
thats the only way to know which block owns that signal event
what would you wait for to know that a signal event has been triggered ?
an arrival of the ____________
signal .
signal event triggers must correspond to the signal owned by the block
note a signal can own properties / attributes. the matching reception would have parameters.
what does a classifier behavior mean = owned behavior of that element
the classifier behavior is assigned by the user to begin ___________
automatically
remember that only receptions can own signals
there must be «signal»
change event triggers begin with when and boolean expression in
parenthesis
a call event trigger corresponds to an OPERATION owned by the blocked that owns the ________ behavior
signal event trigger corresponds to a RECEPTION owned by the blocked that owns the ________ behavior
state machine
Operation and receptions are _________features that that block can perform when called to do so
behavioral
This example shows a call event on a trigger which can only represent a
operation
two kinds of time event
1. relative time event - begins with After 2 mins
2. absolute time event - begins with
at 12:00pm PST
how do relative and absolute time events work in a state machine ?
when would this transition fire ?
1. if the state machine is in the state Hav Comm link
the log system status
if the state machine is at rest and is in another state the time event runs at the specific time but that event gets consumed and nothing gets triggered .
how can you tell if the trigger is a change event trigger ? it begins with the keyword
WHEN
and
when does a change event occur and enter the owning blocks event pool ?
when does a change event occur and enter the owning blocks event pool ?
a change event occurs and enters the event pool at the moment when the boolean expression toggles from false to true
evaluate the run to completion step once the temp is at 90 degrees
the transition would not fire when the state machine starts and temp >90
the change event occurs and enters the event pool at the moment when the boolean expression toggles from false to true
so this scenario the change event will not fire at the online state
Most common kinds of Pseudo states are
1. initial
2.
what do they have in common ?
1. they define control logic.
2. state machine can never be at rest in a pseudo state . it can only be at rest in a state.
junction / compound
state machine behavior must have exactly one initial pseudo state per _______ with an outgoing transition that points to the starting state in that ______
region.
the transition out of a pseudo state cannot have a
- trigger
- guard
but it can have a transition effect ____
behavior
only a transition out of a _____ can have a trigger event specified
but all of the transitions in/out a junction psuedo state can have
1. guard expression
2. transition effect behavior specified.
state
for a junction psuedo state all of the guards in the compound transition get evaluated up front at the moment when the trigger event is ______and removed from the event pool
guards are not evaluated in sequence ( common misconception)
consumed
1 each region must have an initial pseudo state pointing to a starting state
state machine rules
#2 when a state machine is executing , it has EXACTLY one active state at all times .. there cant be two states running at the same time. never in zero or multiple states
#3 each region in a state machine executes concurrently and ______ of each other
#4
independently
when this STM is executing how many active total states are there ?
2