Accept entities from selected entity input port
This page is the block reference page for the Input Switch block introduced before R2016a. To see the documentation on the new Input Switch block, see Entity Input Switch.
This block selects exactly one entity input port for potential arrivals. The selected entity input port can change during the simulation. When one entity input port becomes selected, all others become unavailable.
The rules the block uses for selecting an entity input port are listed in the table.
|Switching criterion Value||Description|
|At the beginning of the simulation, IN1 is selected. After each departure, the block selects the entity input port next to the last selected port. After exhausting all entity input ports, the block returns to the first one, IN1.|
|At the beginning of the simulation and after each departure, the block randomly chooses which entity input port is selected for the next arrival. All entity input ports are equally likely. The Initial seed parameter initializes the random number generation process.|
|Selecting this option creates an additional signal input port, labeled p. The signal at this port must have integer values between 1 and the Number of entity input ports parameter value. The block detects changes in this integer value and selects the corresponding entity input port for future arriving entities.|
If multiple entity input ports of the Input Switch block are on entity paths that come from a single block having multiple entity output ports, include a storage block in each path.
For example, instead of connecting two entity output ports of an Entity Splitter block directly to two entity input ports of an Input Switch block, insert a storage block in each of the two paths.
Entity Input Ports
|IN1, IN2, IN3, and so on||Ports for potential entity arrivals. At any given time, one input port is selected and the others are unavailable. The Number of entity input ports parameter determines how many of these entity input ports the block has.|
Signal Input Ports
|p||Index of the entity input port that is available. Values are
1, 2, 3,..., Number of entity input ports. This
signal must be an event-based signal. You see this port only if you
set Switching criterion to |
Entity Output Ports
|OUT||Port for departing entities.|
Signal Output Ports
|Label||Description||Time of Update When Statistic Is On||Order of Update|
|#d||Number of entities that have departed from this block since the start of the simulation||After entity departure||2|
|last||Index of the input port that was available the last time an entity departed. The initial value is 0. After an entity has departed, values are 1, 2, 3,..., Number of entity input ports.||After entity departure||1|
The initial output value, which is in effect from the start of the simulation until the first update by the block, is 0 for all signals.
Determines how many entity input ports the block has.
The rule that determines which entity input port is selected for receiving entities.
A nonnegative integer that initializes the random number generator
used to select an entity input port. You see this field only if you
set Switching criterion to
Select this option to prioritize the port-selection event explicitly,
relative to other simultaneous events in the simulation. If you do
not select this option, the event has priority
the event calendar. You see this field only if you set Switching
From signal port p.
The priority of the port-selection event, relative to other
simultaneous events in the simulation. You see this field only if
you set Switching criterion to
signal port p and select Resolve simultaneous
signal updates according to event priority.
These parameters determine whether the block produces data at signal output ports or omits those ports. For descriptions of the data and ports, see the preceding table, “Signal Output Ports”.
Allows you to use the signal output port labeled #d.
Allows you to use the signal output port labeled last.