- A state machine is a collection of ____ and ____.
Answer
nodes and transitions
- What is the most basic state machine node class called?
Answer
StateNode
- What is the most basic state machine transition class called?
Answer
Transition
- What is the parent class of StateNode?
Answer
BehaviorBase
- What is the parent class of Transition?
Answer
BehaviorBase
- What action does a StateNode take?
Answer
None; it just sits there waiting for a transition to fire.
- What type of node is used to play a sound?
Answer
SoundNode
- What type of node is used to make LEDs flash?
Answer
LedNode
- What type of node is used to make the robot walk?
Answer
WalkNode
- What method is used to construct the nodes of a state machine?
Answer
setup()
- What method is used to destroy the nodes of a state machine?
Answer
teardown()
- How does a SoundNode indicate that it has finished playing the sound?
Answer
It posts a status event
- How does a LedNode indicate that it has finished a flash operation?
Answer
It posts a status event
- How does a WalkNode indicate that it has finished walking?
Answer
It posts a status event
- What type of transition checks for completion of a state node's action?
Answer
CompletionTrans
- What kind of event does a CompletionTrans look for?
Answer
A status event posted by the transition's source state node
- What does a NullTrans do?
Answer
Null transition: it fires immediately rather than waiting
for a condition to become true.
- How do you tell a state machine to wait for 3 seconds?
Answer
Set up a TimeOutTrans that will fire after 3 seconds.
- In what units is time measured when specifying a TimeOutTrans?
Answer
milliseconds
- How do you get a transition to play a sound when it fires?
Answer
Call its setSound method.
- What does an EventTrans do?
Answer
Waits for the specified event to occur, then fires.
- What is the shorthand notation for a NullTrans?
Answer
=N=>
- What is the shorthand notation for a CompletionTrans?
Answer
=C=>
- What is the shorthand notation for a 3 second TimeOutTrans?
Answer
=T(3000)=>
- What does the $ mean in this expression: foo: SoundNode($,"barkmed.wav")
Answer
The $ is a place-holder for the name of the node, which is "foo".
- What does the $ mean in this expression: >==CompletionTrans($, $$, 1)==> bar
Answer
The $ is a place-holder for the name of the transition, which is probably something like "completiontrans1"
- What does the $$ mean in this expression: >==CompletionTrans($, $$, 1)==> bar
Answer
The $$ refers to the target of the transition, which is the node bar.
- If your behavior is called PoodleBehavior, and it uses the state machine
shorthand notation, what should your source file be called?
Answer
PoodleBehavior.cc.fsm
- What line is used to signal the beginning of state machine shorthand notation?
Answer
#statemachine
- What line is used to signal the end of state machine shorthand notation?
Answer
#endstatemachine
- Where in your behavior's source file should the state machine shorthand notation go?
Answer
Inside the definition of setup()
- How can you use the event logger to monitor state machine execution?
Answer
Tell the event logger to display stateMachineEGID and stateTransitionEGID events.
- When node foo completes its action, we want to transition simultaneously
to nodes bar and baz. How do you write this in shorthand notation?
Answer
foo =C=> {bar, baz}
- When at least two of the nodes foo, bar, and baz have completed their actions,
we want to transition to node xam. Write this in shorthand nodtation.
Answer
{foo, bar, baz} =C(2)=> xam
- When a node posts an event to indicate that its action is complete, what is
the EGID (event generator ID)?
Answer
stateMachineEGID
- When a node posts an event to indicate that its action is complete, what is
the source ID?
Answer
the address of the node
- When a node posts an event to indicate that its action is complete, what is
the ETID (event type ID)?
Answer
statusETID
- When a transition fires, it posts an event. What is the event generator ID?
Answer
stateTransitionEGID
- What does RandomTrans do?
Answer
Fires immediately and transitions to one of its multiple destinations, at random.
- What type of state node is used for visual routines behaviors?
Answer
VisualRoutinesStateNode
- What tool is used to graphically display a state machine execution trace?
Answer
the Storyboard
- What do the square brackets mean in this expression:
CompletionTrans($,$$,1)[setSound("barkmed.wav");]
Answer
The square brackets indicate an initializer expression which will be executed when the state machine is constructed.