Products & Services Solutions Academia Support User Community Company

Learn more about SimEvents   

Assigning Event Priorities

Procedure for Assigning Event Priorities

To assign a numerical event priority to an event, use this procedure:

  1. Find the block that produces the event you want to prioritize. For example, it might be an entity generator, a server, a gate, a counter, or a switch.

  2. If the block's dialog box has an option called Resolve simultaneous signal updates according to event priority, select this option. A parameter representing the event priority appears; in most blocks, the parameter's name is Event priority.

    Selecting Resolve simultaneous signal updates according to event priority check box enables Event priority parameter.

  3. Set the event priority parameter to a positive integer.

Tips for Choosing Event Priority Values

Suppose you want to assign a numerical event priority value for Event X to defer its processing until after some simultaneous Event Y has been processed. A particular value for the event priority is not significant in isolation; what matters is the relative handling of simultaneous events. Keep these tips in mind when choosing a value for the event priority:

For examples that show the effect of changing event priorities, see Example: Choices of Values for Event Priorities and the Event Priorities demo.

Procedure for Specifying Equal-Priority Behavior

If simultaneous events on the event calendar share the same numerical value for their event priorities, then the application arbitrarily or randomly determines the processing sequence, depending on a modelwide configuration parameter. To set this parameter, use this procedure:

  1. Select Simulation > Configuration Parameters from the model window. This opens the Configuration Parameters dialog box.

  2. In the left pane, select SimEvents.

  3. In the right pane, set Execution order to either Randomized or Arbitrary.

    • If you select Arbitrary, the application uses an internal algorithm to determine the processing sequence for events on the event calendar that have the same event priority and sufficiently close event times.

    • If you select Randomized, the application randomly determines the processing sequence. All possible sequences have equal probability. The Seed for event randomization parameter is the initial seed of the random number generator; for a given seed, the generator's output is repeatable.

The processing sequence might be different from the sequence in which the events were scheduled on the event calendar.

  


Related Products & Applications

Learn more about Simulink through this collection of videos, articles, technical literature and the Getting Started with Simulink Guide.

 © 1984-2009- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS