Page 160 - ExtendSim User Guide
P. 160

Items, Properties, and Values
Item properties
☞ The Select Item Out block does not assign or use items’ priorities. Instead its output connectors can be prioritized so that an item will be routed to the first available connector that has the highest priority. As shown in “Explicit ordering” on page 167, the Select Item Out block prior- itizes the path an item will take rather than the item itself.
Priorities model
In the example, a Random Number block (Value library) outputs values to a Set block, as fol- lows:
• 10%ofthetimeitoutputsa1
• 40%itoutputsa2
• For the remaining 50% it outputs a 3.
Priorities model
The table in the dialog of the Set block indicates it will assign priorities to incoming items. Connecting from the Random Number block’s output to the Set block’s ItemPriority value input connector causes the priorities to be set according to the values from the Random Num- ber block. Since the lowest number is the highest priority, 10% of the time items will be assigned the highest priority.
The Queue block is set to sort by priority. This means that the highest priority items held in the block will be made available to the Activity block before other items. A History block, added to the model by right-clicking on the Queue’s output connector, shows that only top priority items are processed; the Activity cannot keep up with the demand.
The section “Interrupting processing” on page 191 shows how priority values are used to determine if one item should preempt another.
☞ For an item to be ranked by priority, there must be other items in the group at the same time. For example, items will only be sorted by priority in a Queue block if they have to wait there with other items.
Quantity is another type of property that can be assigned to items. Each item can be a single entity or a group of duplicates. As is true for priority, an item can only have one quantity assigned to it at a time; the default quantity is 1. If the quantity property for an item is 1, it rep- resents one item. If the quantity is other than 1, it represents a group. Item quantities are typi- cally set in the Create and Set blocks.
☞ An item’s quantity can be any number, including a negative number. An item with a quantity of 0 or less disappears when it reaches a queue.
Discrete Event

   158   159   160   161   162