Page 218 - ExtendSim User Guide
P. 218

192 Processing
Interrupting processing
• Shutdownoccurswhenprocessingissuspendedforoneormoreitemscurrentlyinan Activity block. Items that have been shut down may or may not have their processing com- pleted when the shutdown ends. In any case, they are either discarded or leave through the normal item output connector.
The Activity block has a Preempt tab for specifying what to do when there is preemption and a Shutdown tab for controlling what happens when the block gets a message to shutdown. The Convey Item block can be shutdown by reducing its speed to zero. The Shutdown block is most commonly used for shutting down an activity.
☞ Preemption and shutdown are discussed in the following two sections. The models for those sections are located in Examples\Discrete Event\Processing\Preemption and Shutdown folder.
Preemption occurs when a signal is received at an Activity block's PE (preempt) input, prema- turely ending an item's processing by forcing it to leave through an alternate output.
In the Preempt tab you can specify that preemption occurs only if the block is already process- ing its maximum number of items and that the preempted item's remaining processing time be stored as an attribute for subsequent processing. Once preempted, the item’s processing can be finished by another Activity, finished later by the original block, or never finished at all, depending on how the item is routed in the model.
PE input connector
Once preemption is enabled in the Preempt tab, the PE (preempt) universal input connector and an alternate item output connector appear on the Activity’s icon. The connection to the PE connector can either be a value input or an item input, depending on what is selected in the Pre- empt tab. The type of connection to the PE input determines how preemption is controlled:
• Value connection. Based on which of the first four preemption options (discussed below) is chosen, the selected item or items will be preempted whenever a true (0.5 or greater) value is received at the PE input.
• Itemconnection.Whena“preemptionitem”arrivesatthePEconnector,theActivitylooks up the specified attribute value on the preemption item. The Activity then searches all items currently in processing, and any of those items with an attribute value equal to the one on the preemption item will be required to leave the block. In addition, the Activity block has an option to transfer attributes from the preemption item to the preempted items.
Preemption options
As discussed above, preemption occurs when a signal is received at an Activity block’s PE (preempt) input. Settings in the block’s Preempt tab determine which item or items must leave. Depending on whether the preempt signal is sent by a value or an item connector, the preemp- tion options are:
• The item that is closest to finishing
• The item that is furthest from finishing
• The item with the lowest priority
• Allitemscurrentlybeingprocessed
• Onlyitemswithaparticularattributevalue
Discrete Event

   216   217   218   219   220