Building a Model with Elementary Components

Switch Component

The Router and Switch components are for controlling the flow of transactions as a function of the state of the simulation. The Router can have a formula associated with each arc directed away from it. When a transaction arrives at the Router, each formula is evaluated and the transaction flows down all arcs with formulas that evaluate to TRUE. The Switch is similar to the Router, but it has only one formula associated with it. The formula evaluation is interpreted as a case, which identifies an arc or set of arcs down which the transaction should flow. If the evaluation does not identify a valid case, the transaction flows out the Balk node.

cpswitch.gif (7717 bytes)

Figure 3.10: Switch Control Panel

Figure 3.10 shows the control panel for a switch connected to two queues as in Figure 3.11. Selecting the Formula button displays a Formula Manager Window (see Chapter 5). There you build, verify, and save the formula associated with the switch. When a transaction arrives at the switch, the formula associated with the switch is evaluated. This value is compared to each of the cases listed in the Switch control panel. The transaction flows down the arcs associated with each of the cases that match. You can associate arcs with a case by selecting a case and pressing the Edit button. This displays the Switch Control Panel, as shown in Figure 3.10. In this window you select one or more of the listed components. For example, a Switch can be used to direct transactions to the smaller of two queues.

switchmo.gif (2726 bytes)

Figure 3.11: Switch Controlled Queue Selection

The following documents the logic of the Switch component.

Transaction Arrival

evaluates the formula for the switch. The transaction flows down the arcs leaving the switch that have case values matching the formula evaluation. If there is no match, the transaction flows out the balk node.

Request for Transaction

The request is sent up each arc directed into the component.

Are You Busy Message

If any of the components on arcs directed out of the Switch is busy, then return TRUE; else, return FALSE.

Query Message

Keyword Meaning
idreturns the component's unique identifier

Trigger Message

Keyword Meaning
resetresets the Switch
startstarts the Switch
stopstops the Switch

Previous Page | Next Page | Top of Page