Stateflow User's Guide Previous page   Next Page

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):

  1. Endpoint Hierarchy -- Transitions whose end points are attached to higher hierarchical levels are placed first in testing order. See the topic Ordering by Hierarchy.
  2. Label -- Transitions are ordered for testing according to the types of action language present in their labels. See Ordering by Label.
  3. Angular Surface Position of Transition Source -- Transitions are ordered for testing based on the angular position of the transition source on the surface of the originating object. See Ordering by Geometric Position of Source.

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:

  1. Labels with events and conditions
  2. Labels with events
  3. Labels with conditions
  4. No label

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:

  1. Starting at the upper left corner of the source state A in a clockwise progression, the first transition is the transition from state A to state B.
  1. Since the condition [C_one == 1] is false, this transition is not valid.

  1. The next transition in a clockwise progression is the transition from state A to state C.
  1. Since the condition [C_two == 2] is false, this transition is not valid.

  1. The next transition is the transition from state A to state D.
  1. Since the condition [C_three == 3] is true, this transition is valid and is taken.

Multiple outgoing transitions from junctions that are of equivalent label priority are evaluated according to the same angular position prioritization.

In this example,

The outgoing transitions from the junction are evaluated in the following order:

  1. The transition to state B is evaluated. Since the condition [C_one == 1] is false, this transition is not valid.
  2. The transition to state C is evaluated. Since the condition [C_two == 2] is false, this transition is not valid.
  3. The transition to state D is evaluated. Since the condition [C_three == 3] is true, this transition is valid and taken.
  1. Since the transition to D is taken, the transition to state E is not evaluated.


Previous page  Transition Testing Order Explicit Order Mode Next page

© 1994-2005 The MathWorks, Inc.