Chapter Contents
Chapter Contents
Building a Model with Elementary Components

Queue Components

Queue components are transient storage for transactions. There are three types of queues: FIFO Queues, LIFO Queues, and Priority Queues.

fqueue.gif (969 bytes)FIFO Queuesfirst-in-first-out
lqueue.gif (969 bytes)LIFO Queueslast-in-first-out
pqueue.gif (962 bytes)Priority Queuespriority

Each type of queue can behave as a buffer. This means that when the transaction first arrives, the queue will not try to route it to a nonbusy component but will wait for a request for transaction message from a downstream component before sending it on. In addition, you can have the queue behave as a buffer for some downstream components and as a standard queue for others. Those components in the Don't push to listbox in the Queue Control Panel (see Figure 2.5) define components for which the queue acts as a buffer. Those components in the Push to listbox define components for which the queue acts as a standard queue.

The LIFO and FIFO queues order transactions according to their arrival time. The Priority Queue uses the value of the numeric transaction attribute named "priority" to determine placement location in the queue. This default name can be changed. The priority attribute can be assigned to a transaction by the Modifier component, discussed in the section "Logic Components". By default, the smaller the value of the attribute, the higher placement in the queue and the sooner the element will leave the queue. Although this is the default priority order, it can be changed by unselecting the "Ascending Priority Order" check box on the control panel shown in Figure 2.5.

cpfifoqu.gif (5019 bytes)

Figure 2.5: The Priority Queue Control Panel

When each transaction leaves the queue, it has an attribute with the time it spent in the queue. The name of this attribute can be specified in the queue control panel. See Figure 2.5 for where to give the attribute name. By default the attribute name for all queues is "queue."

The following documents the logic of the Queue components.

Transaction Arrival

If the queue is off or at capacity, the transaction flows out the Balk node; otherwise, it sends the message are you busy to the nodes on arcs directed away from the queue and listed in the Push to list box. If FALSE is returned, then route the transaction there; otherwise, queue the transaction.

Request for Transaction

If the queue is not empty (size > 0), then remove the next transaction according to the type of queue and send it out the arc directed to the component that made the request; otherwise, return FALSE.

Are You Busy Message

always returns FALSE.

Query Message

Keyword Meaning
capacityreturns the queue's capacity
idreturns the queue's unique identifier.
releaseTypereturns a string naming the way that the last transaction
 was released from the balk node. Possible values are: "balk," "empty,"
 "filter," "filterOne," and "releaseOne."
sizereturns the number of transactions that are in the queue.
spacereturns TRUE if there is unused capacity in the queue.

Trigger Message

Keyword Meaning
balkcauses the transaction at the Trigger to leave the queue from the Balk node.
emptyempties the queue of all transactions. Note that the transactions
 do not leave via the Balk node.
filterevaluates a formula for each transaction in the queue. If the
 formula evaluates to TRUE, the transaction balks; otherwise, it
 maintains its place in the queue. The formula that is evaluated should
 be in an attribute named ''formula'' in the triggering transaction.
filterOneevaluates a formula for each transaction in the queue.
 The first transaction for which the formula evaluates to TRUE balks.
 The formula that is evaluated should be in an attribute named "formula"
 in the triggering transaction.
insertinserts the transaction at the Trigger into the queue.
releaseOnereleases one transaction from the queue via the the Balk node.
resetdestroys all transactions in the queue.
startstarts the queue.
stopstops the queue.

Chapter Contents
Chapter Contents

Copyright © 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.