Page 184 - ExtendSim User Guide
P. 184

158 Routing
Items from several sources
Select Item In dialog
The Select Item In block chooses an item from one of its input connectors and sends that item to its output connector. The selection is based on settings and options in the block’s dialog.
Selection options
The Select Item In block has several rules for selecting an item from its input connectors:
• Item priority. Selects the input connector that has an available item with the highest priority (the lowest numerical value for its priority.) For example, you could use this option to select from a group of queues to a single activity. The queue with the item that has the highest pri- ority will be selected. This option always starts and restarts its selection search at the top input.
• Random.Theinputsareselectedrandomlybasedonprobabilitiesenteredintheblock’s selection table. Enter probabilities in decimal format. For example, enter 0.75 for 75%. If the entered numbers do not equal 1.00, the actual sum will appear in red in the bar below the Probability column. If Select from: all inputs is chosen, an input will be randomly selected whether or not an item is available at that input. This situation can potentially cause starving, as discussed below. If Select from: only inputs with available items is chosen, the block will only select from inputs with available items.
• Selectconnector.Thevaluereceivedattheselectconnectordetermineswhichinputis chosen. The block’s dialog has an option for setting which value chooses the top input; the default is 0. The lower connectors will be numbered sequentially after the top connector. That is, if the top input is chosen by a select value of 1, the second input will be numbered 2, the next lower input would be numbered 3, and so forth. In that case, a value of 3 at select would cause the item from the third connector from the top to be selected. Note that, even if items are available at the other inputs, the block will wait for an item at input 3, potentially causing starving as discussed below.
☞ See “Item library blocks” on page 313 for some precautions when using this option with a Get block.
• Sequential.Selectstheinputsinstrictsequentialorderstartingatthetop;thisisalsoknown as a “round robin” selection. This option could cause starving (discussed below), since the block will wait for an item to become available at each selected input.
• Merge.Itemsaretakenastheybecomeavailablethroughanyinput.Generally,thisoptionis used to combine the flows of items where there is no blocking of items arriving at the Select Item In block. Inputs are selected in a “round robin” fashion starting from the top; once a selection has been made the selection search will resume at the next lower input.
☞ Residence blocks such as the Activity have variable item input connectors. This works the same as using the Select Item In block in Merge mode to merge multiple item streams.
Starving conditions
If an item is not available from the selected input of a Select Item In block, the following options will cause a starving condition:
• Random(ifSelectfrom:allinputsischosen) • Select
• Sequential
Discrete Event

   182   183   184   185   186