Chapter Contents
Chapter Contents
Building a Model with Elementary Components

NumberHolder Components

There are various ways to both save information and retrieve information from holders. The values of attributes carried by transactions can be saved in a holder when the transaction enters the holder. Alternatively, a value can be saved in a holder when a transaction enters a trigger in some other part of the simulation model. For example, suppose that you want to save the value of a transaction attribute called "weight" in a NumberHolder.

nholderm.gif (1759 bytes)

Figure 2.12: Number Holder Saving "weight" Attribute

In the model fragment in Figure 2.12, when the transaction arrives at the Trigger, the value of the weight attribute in that transaction is saved in the NumberHolder. Now, another part of the simulation can query the NumberHolder to find the current value of weight. You could also route the transaction directly to the NumberHolder and update its state that way.

You specify the name of the attribute that is stored in the NumberHolder in the NumberHolder Control Panel, which is displayed by selecting Control Panel... selection on the pop-up menu on the NumberHolder.

cpnholde.gif (5634 bytes)

Figure 2.13: Number Holder Control Panel

Notice that the NumberHolder control panel shown in Figure 2.13 has the attribute name "weight" in the Attribute Name field.

The transaction sets the NumberHolder when it arrives at the Trigger because the Trigger Control Panel, as shown in Figure 2.14, has the NumberHolder component selected and the setFromAttribute selected.

cptrigg2.gif (8145 bytes)

Figure 2.14: A Trigger Control Panel

The Initial Value field in the holder control panels provide a way of initializing the holder. This is useful when using the holder as a counter of resources. When the NumberHolder decrements, there is one less available resource. Other parts of the model may query the holder to see if there are resources available for certain activities. In this case it may be desirable to have an initial pool available.

The Disable Reset check box will disable the resetting of the last value in the holder when the simulation reset button is pressed. If not checked, when the reset button is pressed the holder is reset to its initial value. If checked, the reset button has no affect on the holder.

The following documents the logic of the NumberHolder component:

Transaction Arrival

sets the value as specified in the NumberHolder Control Panel; then flows the transaction to each arc directed away from the component.

Request for Transaction

passes on the request to all arcs directed into the component.

Are You Busy Message

if any component on an arc leading out of the Trigger is busy, then return TRUE; otherwise, return FALSE.

Query Message

Keyword Meaning
currentValuereturns the value in the holder at the current time
idreturns the component's unique identifier.
valuereturns the value in the holder when the transaction passed through it.

Trigger Message

Keyword Meaning
+adds the transaction attribute to the value.
-subtracts the transaction attribute from the value.
clearSetFromAttributeclears the value then sets it.
controlsdisplays the Holder Control Panel.
decrementdecrements the value.
incrementincrements the value.
printprints the value on the SAS Log window.
resetresets the value and the value.
setFromAttributesets the value from the transaction attribute.
setFromTriggersets the value that is assigned with the
 Trigger Value button in the Trigger Control Panel.
setTimenowsets the simulation time into the value.
startstarts the holder.
stopstops the holder.

Chapter Contents
Chapter Contents

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