Building a Model with Elementary 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.
Figure 3.12: Number Holder Saving "weight" Attribute
In the model fragment in Figure 3.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... from the pop-up
menu on the NumberHolder.
Figure 3.13: Number Holder Control Panel
Notice that the NumberHolder control panel shown in Figure 3.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 3.14,
has the NumberHolder component selected and the
setFromAttribute selected.
Figure 3.14: A Trigger Control Panel
The Initial Value field in the holder control panel provides 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 effect on the holder.
The following documents the logic of the NumberHolder component.
sets the value as specified in the NumberHolder Control Panel; then flows the transaction to each arc directed away from the component.
passes on the request to all arcs directed into the component.
If any component on an arc leading out of the Trigger is busy, then return TRUE; otherwise, return FALSE.
Keyword | Meaning |
---|---|
currentValue | returns the value in the holder at the current time |
id | returns the component's unique identifier |
value | returns the value in the holder when the transaction passed through it |
Keyword | Meaning |
---|---|
+ | adds the transaction attribute to the value |
- | subtracts the transaction attribute from the value |
clearSetFromAttribute | clears the value then sets it |
controls | displays the Holder Control Panel |
decrement | decrements the value |
increment | increments the value |
prints the value on the SAS Log window | |
reset | resets the value . |
setFromAttribute | sets the value from the transaction attribute |
setFromTrigger | sets the value that is assigned with the |
Trigger Value button in the Trigger Control Panel | |
setTimenow | sets the simulation time into the value |
start | starts the holder |
stop | stops the holder |
Copyright © 2008 by SAS Institute Inc., Cary, NC, USA. All rights reserved.