Switch Block

switchHelp

Description

The Switch block directs the flow of an entity through a simulation model. You define switch cases on the Switch block. The case names must be unique, and each switch case must have an integer value (called the switch value) associated with it. When an entity enters a Switch block, the block calculates the switch value to be used for the entity. Depending on the Switch block configuration, the block either attempts to extract the switch value from an attribute in the entity or pulls it from the InSwitchValue port. After the switch value is acquired, the Switch block searches the cases in its Cases table until it finds a case with the same switch value. The entity is then pushed out the entity out port associated with the matching case. If a match is not found, the entity is sent out the OutDefault port.

Fixed Ports

InEntity

Input entity port for entities to enter the Switch block.

OutDefault

Output entity port for entities that do not match a switch case defined for the Switch block.

OutBalk

Output entity port for entities that cannot leave using the other output entity ports.

InSwitchValue

Input integer port for the switch value to be used for the next entity, if the Switch block is configured to obtain the switch value from this port rather than from an entity attribute.

Properties Dialog Box Controls

Add

Adds a new switch case to the Cases table with a default Name and Value. You can edit the Name and Value of the switch case directly in the table. The case names and values used by a Switch block must be unique.

Remove

Deletes the selected switch case from the Cases table.

Switch Value

If you select the Port option, the Switch block pulls the switch value from the InSwitchValue port. If you select the Entity option, you must also supply the name of an attribute in the Entity Attribute field. The Switch block attempts to extract the switch value from the appropriate attribute on the entity.

Apply

All values in the Cases table are saved to the Switch block and any entity output ports are created or deleted as needed.

Candidates for Design of Experiments

Factors

None

Responses

None