Complete the code to define a state in a hierarchical state machine.
state = State([1]);The correct way to define a state with a name is to use name='Start'.
Complete the code to add a substate to a parent state.
parent_state.add_substate([1]);You add a substate by passing the child state object, here named child_state.
Fix the error in the transition definition by completing the code.
transition = Transition(source_state, [1], target_state);The transition requires the event name that triggers it, so 'event_name' is correct.
Fill both blanks to create a hierarchical state machine with a parent and a child state.
parent = State([1]) child = State([2]) parent.add_substate(child)
The parent state is named 'Parent' and the child state is named 'Child' to show hierarchy clearly.
Fill all three blanks to define a transition in a hierarchical state machine.
transition = Transition([1], [2], [3])
The transition needs the source state, the event trigger, and the target state. Conditions are optional and not included here.
