Main Content

Entity Gate

Gate entities

  • Library:
  • SimEvents

  • Entity Gate block

Description

The Entity Gate block controls when pending entities can advance in the model.

The Operating mode parameter specifies how the pending entities advance through the gate.

  • Enable gate — opens and allows entities to advance whenever the control port receives an anonymous entity with a positive value, and closes whenever it has zero or a negative value. For more information, see Use Queue Event Actions to Model a Storage Tank.

  • Release gate — allows one pending entity to advance when an anonymous entity arrives on the control port. At all other times, the entity input port of the block is unavailable.

  • Selection gate — allows entities to advance whenever the anonymous entity value from the control port matches the attributes of the pending entities.

Use the Entity Gate block to control the flow of entities on the entity path. Use the Entity Output Switch block to select an output port for the departure of an entity among multiple entity output ports. For more information, see Route Vehicles Using an Entity Output Switch Block.

Ports

Input

expand all

Input entity that carries scalar, bus, or vector data to enter the gate.

Data Types: single | double | int8 | int16 | int32 | int64 | uint8 | uint16 | uint32 | uint64 | Boolean | enumerated | bus | string | fixed point

Input control port to accept the entity that determines the state of the gate.

Data Types: single | double | int8 | int16 | int32 | int64 | uint8 | uint16 | uint32 | uint64 | fixed point

Output

expand all

Output entity port for entities leaving the gate.

Data Types: single | double | int8 | int16 | int32 | int64 | uint8 | uint16 | uint32 | uint64 | Boolean | enumerated | bus | string | fixed point

Parameters

expand all

Select the mode of operation of this gate. With the Operating mode parameter set to:

  • Enable gate, this block represents a gate that opens whenever the control port receives an anonymous entity with a positive value, and closes whenever it has zero or a negative value. By definition, an open gate permits entity arrivals as long as the entities are able to immediately advance to the next block, while a closed gate forbids entity arrivals. The anonymous entity that is received at the control port has a numerical value of type double. Since the gate receives an anonymous entity with a positive value and opens, an enabled gate remains open until it receives an entity with zero or a negative value and closes.

  • Release gate, this block permits the arrival of one pending entity when an anonymous entity arrives on the control port. At all other times, the entity input port of the block is unavailable. By definition, the opening of the gate permits one pending entity to arrive if the entity is able to immediately advance to the next block.

  • Selection gate, this block permits the arrival of pending entities whenever the anonymous entity value from the control port matches the attributes of the pending entities. Otherwise it prevents the arrival of pending entities.

Programmatic Use

Block Parameter: OperatingMode
Type: character vector
Values: 'Enable gate' | 'Release gate' 'Selection gate'
Default: 'Enable gate'

Name of the attribute to match the value from the control port.

Dependencies

This parameter is visible when you set Operating mode to Selection Gate.

Programmatic Use

Block Parameter: MatchingAttributeName
Type: character vector
Values: 'Attribute1' | character vector
Default: 'Attribute1'

Specify the initial value to match the matching attribute which opens the gate.

Dependencies

This parameter is visible when you set Operating mode to Selection Gate.

Programmatic Use

Block Parameter: InitialValueOfMatchingAttribute
Type: character vector
Values: 'NaN' | scalar
Default: 'NaN'

Select this option to open the gate at the start of the simulation.

off

Gate is closed at the start of the simulation.

on

Gate is open at the start of the simulation.

Programmatic Use

Block Parameter: OpenGateAtSimulationStar
Type: character vector
Values: 'on' | 'off'
Default: 'off'
Introduced in R2016a