This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English version of the page.

Note: This page has been translated by MathWorks. Click here to see
To view all translated materials including this page, select Country from the country navigator on the bottom of this page.

Entity Input Switch

Switch input entities

  • Library:
  • SimEvents

Description

Note

This page is the block reference page for the Input Switch block introduced in R2016a. To see the documentation on the previous Input Switch block, see Input Switch (Obsolete).

The Entity Input Switch block allows arrival of entities at its ports. The selected entity input port can change during the simulation. You can specify the active input port to allow arriving entities to all of the input ports or to switch the active port that allows the arrival of an entity at only one port at a time.

You can select the criterion for switching between input ports.

  • Select Round robin to select ports in a round robin fashion. For more information, see Select Arrival Path Using Entity Input Switch.

  • Select From control port to let the control port determine the selected port.

  • Select Equiprobable to let the block randomly select any port with equal probability.

For an example, see Generate Entities When Events Occur.

Ports

Input

expand all

Input entity port for entities entering the block.

Data Types: single | double | int8 | int16 | int32 | uint8 | uint16 | uint32 | Boolean | enumerated | bus

Input entity port for entities entering the block.

Data Types: single | double | int8 | int16 | int32 | uint8 | uint16 | uint32 | Boolean | enumerated | bus

Input control port for the incoming control entity that determines the input port for the entities arriving at the block.

Data Types: single | double | int8 | int16 | int32 | uint8 | uint16 | uint32

Output

expand all

Output entity port for entities exiting the block.

Data Types: single | double | int8 | int16 | int32 | uint8 | uint16 | uint32 | Boolean | enumerated | bus

Parameters

expand all

Determines how many entity input ports the block has.

Programmatic Use

Block Parameter: NumberInputPorts
Type: character vector
Values: '2' | scalar
Default: '2'

Specify the active input port to allow arrival of entities at all ports or one port at a time. Select All to combine entity paths and allow arrival of entities at all ports. Select Switch to allow arrival of an entity at only one port at a time.

Programmatic Use

Block Parameter: ActivePortSelection
Type: character vector
Values: 'All' | 'Switch'
Default: 'All'

Select the criterion for switching between input ports.

  • Select Round robin to select ports in a round robin fashion. Set the initial port in the Initial port selection. For more information, see Select Arrival Path Using Entity Input Switch.

  • Select From control port to let the control port determine the selected port. A control port will appear to input an anonymous entity carrying data with a value greater than 0, and smaller than or equal to the number of input ports to determine the active port.

  • Select Equiprobable to let the block randomly select any port with equal probability. Set the Seed to generate a random number and to determine the active input port.

Programmatic Use

Block Parameter: SwitchingCriterion
Type: character vector
Values: 'Round robin' | 'From control port' | 'Equiprobable'
Default: 'Round robin'

Specify initially which port allows arrival of an entity.

Programmatic Use

Block Parameter: InitialPortSelection
Type: character vector
Values: '1' | scalar
Default: '1'

Specify the seed for the random number generator to determine the input port.

Dependencies

This parameter is visible when Switching criterion is set to Equiprobable.

Programmatic Use

Block Parameter: Seed
Type: character vector
Values: '23453' | scalar
Default: '23453'

Introduced in R2016a