Input Switch - Accept entities from selected entity input port

Library

Routing

Description

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 possible rules the block uses for selecting an entity input port, as well as the corresponding values of the Switching criterion parameter in the dialog box, are listed in the table below.

Switching criterion ValueDescription
Round robinAt 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.
EquiprobableAt 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.
From signal port pSelecting 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.

Ports

Entity Input Ports

LabelDescription
IN1, IN2, IN3, etc.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

LabelDescription
pIndex of the entity input port that is available. Values are 1, 2, 3,..., Number of entity input ports. This port appears only if you set Switching criterion to From signal port p.

Entity Output Ports

LabelDescription
OUTPort for departing entities.

Signal Output Ports

LabelDescriptionTime of Update When Statistic Is OnOrder of Update
#dNumber of entities that have departed from this block since the start of the simulation.After entity departure2
lastIndex 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 departure1

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.

Dialog Box

Input Switch Tab

Number of entity input ports

Determines how many entity input ports the block has. This parameter must be a literal value, not a variable or an expression requiring evaluation.

Switching criterion

The rule that determines which entity input port is selected for receiving entities.

Initial seed

A nonnegative integer that initializes the random number generator used to select an entity input port. This field appears only if you set Switching criterion to Equiprobable.

Resolve simultaneous signal updates according to event priority

Select this option to explicitly prioritize the port-selection event, relative to other simultaneous events in the simulation. If you do not select this option, the event has priority SYS1 on the event calendar. For details, see Choosing How to Resolve Simultaneous Signal Updates. This field appears only if you set Switching criterion to From signal port p.

Event priority

The priority of the port-selection event, relative to other simultaneous events in the simulation. For details, see Specifying Event Priorities to Resolve Simultaneous Signal Updates. This field appears only if you set Switching criterion to From signal port p and select Resolve simultaneous signal updates according to event priority.

Statistics Tab

These parameters determine whether certain ports produce data throughout the simulation, produce data only when you stop or pause the simulation, or are omitted from the block. For descriptions of the affected ports, see the "Signal Output Ports" table above.

Number of entities departed

Controls the presence and behavior of the signal output port labeled #d.

Last entity arrival port

Controls the presence of the signal output port labeled last.

Examples

See Also

Output Switch

Using the Input Switch

  


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