Resources


Preempting Resource Entities

In Simulation Studio, the stationary resources (including most of the entity holding blocks, such as the Queue, Server, and Delay blocks) support two common types of resource preemptions: priority-based and scheduled.

Priority-based preemption is primarily for preempting stationary resources, which are the entity holding blocks such as the Queue, Server, and Delay blocks. The entity that wants to enter such a holding block is considered a consumer of the static resource that is represented by that block. Allocation of static resources is usually about accepting entering entities into the holding blocks to take up space in the blocks. Preemption of static resources forces out some entities currently in holding blocks to give spaces to some other entities. The selected holding blocks (Queue, Server, and Delay) provide an InPreempt input port that accepts an EntityGroup object as input. These blocks compare the entity references in the EntityGroup to the entities that are currently held by the block and preempt any matches. This type of preemption is often triggered by the higher priority of the new entities attempting to enter these blocks.

Scheduled preemption is primarily for preempting mobile resources, which are resource entities, and is based on a resource adjustment agenda. Sometimes, the allocated and seized resource entities need to be preempted from their current controlling entities so that these resource entities can be re-allocated to other controlling entities if necessary. This type of preemption can be triggered by the preemptive resource adjustments that are arranged and processed by a Resource Scheduler block. Most entity holding blocks, including the Queue, Server, and Delay blocks, provide OutPreempt and OutResource output ports. If a resource entity that is allocated to a controlling entity that is currently held in a holding block is adjusted preemptively, the holding block attempts to force the controlling entity out of the block’s OutPreempt port and the resource entity out of the OutResource port. If the OutPreempt port is not connected, the controlling entity remains in the entity holding block. If the OutResource port is not connected, the adjusted resource entity remains allocated to its controlling entity.

The post-preemption processing of preempted entities and resources is often highly specific to the application. For example, when a job is preempted from a service, some applications might resume the job to finish its remaining service time, some might restart the job from beginning, some other applications might simply scrap the job, and so on. The modeling facilities provided by Simulation Studio make it possible to construct suitable solutions to handle these situations.

Additional examples that demonstrate preemption and other resource modeling techniques are provided in Appendix E: Examples of Simulation Studio Models.