| Stateflow User's Guide | ![]() |
Implicit Order Mode
Implicit order mode is the default mode both for old models and for newly created models. Transitions from a single source are ordered for testing according to the following three sorting guidelines, which appear in order of their precedence (first step is highest priority):
Ordering by Hierarchy
Transitions are evaluated in a top-down manner based on hierarchy. In the following example, an event occurs while state A1 is active.
Because state B is a sibling of state A and at a higher hierarchical level than state A2, a sibling of A1, the transition from state A1 to state B takes precedence over the transition from state A1 to state A2.
Ordering by Label
Transitions of equal endpoint hierarchical level are evaluated based on their labels, in the following order of precedence:
The following example demonstrates ordering of single source transitions by the angular surface position of the source.
Ordering by Geometric Position of Source
Equivalent transitions (based on their labels and the hierarchy of their source and endpoints) are ordered based on the angular position on the surface of the source object for the outgoing transitions. The smallest clock position has the highest priority. For example, a transition with a 2 o'clock source position has a higher priority than a transition with a 4 o'clock source position. A transition with a 12 o'clock source position has the lowest possible priority.
Multiple outgoing transitions from states that are of equivalent label and source and end point hierarchy priority are evaluated in a clockwise progression starting at the upper left corner of the source state.
In this example, the transitions are of equivalent label priority. The conditions [C_onw == 1] and [C_two == 2] are both false and the condition [C_three = = 3] is true. Also, the hierarchical level of the endpoint of each transition is the same because all the states in the example are siblings.
The outgoing transitions from state A in the preceding diagram are evaluated in the following order:
A to state B.
Multiple outgoing transitions from junctions that are of equivalent label priority are evaluated according to the same angular position prioritization.
C_three == 3] and [C_four == 4] are true.
The outgoing transitions from the junction are evaluated in the following order:
C_one == 1] is false, this transition is not valid.
C_two == 2] is false, this transition is not valid.
C_three == 3] is true, this transition is valid and taken.
| Transition Testing Order | Explicit Order Mode | ![]() |
© 1994-2005 The MathWorks, Inc.