Chapter Contents |
Previous |
Next |
Building a Model with Elementary Components |
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.
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.
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:
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 and 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. |
Chapter Contents |
Previous |
Next |
Top |
Copyright © 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.