The resource facilities in Simulation Studio provide more advanced functionality than demonstrated in the previous simple banking system example. To illustrate some of this additional functionality, the previous banking system model has been extended. The basic premise remains the same—customers arrive at the bank and wait to be served by a bank teller. However, in this new model there are three bank tellers, not all of whom are available during the entire simulation run. This model also collects utilization statistics for the bank teller resource entities.
Figure 9.6 shows the new model. You can find the project files for this example (named projects\docSchedule
) in the examples
directory under your Simulation Studio installation directory. The most obvious difference between this resource model and
the previous one is the addition of the Resource Agenda, Resource Scheduler, and Resource Stats Collector blocks. A less obvious
difference is the creation, storage, and allocation approach used here for the three bank teller resources.
Figure 9.6: Banking System Model That Uses Resource Scheduling
There are two options for creating the three bank teller resources. Either you can create three BankTeller resource entity
objects, each of which has a ResourceUnits value of 1
, or you can create one BankTeller resource entity object that has a ResourceUnits value of 3
. To demonstrate the merging/splitting feature in Simulation Studio, this model uses the latter approach.
The Create Teller block generates one BankTeller resource entity object and passes it to the Teller Pool block, just as in
the previous model. This time, the resource entity attribute of the resource entity object is equal to 3
instead of 1
. To make efficient use of the ResourceUnits in the BankTeller resource entity object, it is necessary to use the Resource
Pool block’s merging and splitting resource entities capabilities. Selecting the Merge/Split resource units among resource entities of same type check box in the Block Properties for Teller Pool dialog box (see Figure 9.7) enables the block to look at the ResourceUnits attribute of its held resource entities and possibly subdivide a resource
entity into two resource entities, one of which matches the needs of an incoming resource request. In this example, the Seize
Teller block requests a BankTeller resource entity that has one ResourceUnit. With the merge/split option selected, the Teller
Pool block can take a BankTeller resource entity that has a ResourceUnits value of 3, create a new BankTeller resource entity
object that has a ResourceUnits value of 1, and decrease the ResourceUnits value of the existing BankTeller resource entity
(already in the pool) to 2. The new BankTeller resource entity object (which has a ResourceUnits value of 1) is sent to the
Seize Teller block to satisfy its request.
Similarly, when the BankTeller resource entity object returns to the Teller Pool block, its ResourceUnits can be merged with a BankTeller resource entity already in the pool, and the incoming BankTeller resource entity object is disposed.
Figure 9.7: Teller Pool Block Properties Dialog Box
For this model, all three bank tellers might not be available during the entire simulation—maybe they take a staggered lunch break. The previous model used a total simulation time of 9 hours (540 minutes). Assume in this model that for the first 4 hours (240 minutes) of the work day, all three bank tellers are available. For the next hour, two of the tellers go on lunch break and when they return, the third teller takes an hour lunch break. When the third teller returns from lunch break, all three tellers are available for the remainder of the work day.
A Resource Agenda block and a Resource Scheduler block are used together to implement the scheduling functionality in this model. A Resource Agenda block is used to create a list of resource adjustment actions (collectively known as a resource agenda) to be performed during the simulation run. The resource agenda information is passed to a Resource Scheduler block to arrange and perform the resource adjustment actions on specific resource entities. Figure 9.8 shows the Resource Agenda Block Properties dialog box for this model. Each row or entry in the agenda represents a resource adjustment action and consists of three pieces of information: Duration, Value, and Value Type. For a complete description of each of these fields, see the Resource Agenda block description in Appendix A: Templates. For this model, these entries represent the changes in the number of bank tellers throughout the simulation period.
Figure 9.8: Resource Agenda Block Properties Dialog Box
The Resource Scheduler block receives the resource agenda at the beginning of the simulation run through its InAgenda input value port, and the scheduler performs the sequence of resource adjustments on a specified group of targeted resource entities. The block properties dialog box that is associated with the Resource Scheduler block in this model is shown in Figure 9.9. Each row in the Appointments table is called an appointment. For more information about using the Resource Scheduler block, see Appendix A: Templates. Only the Start Time, Agenda, and Search Targets By fields are discussed here. The Start Time field specifies the simulation time to activate the associated agenda. The Agenda field supplies the name of the incoming agenda to use for this appointment. (Multiple Resource Agenda blocks can be linked to the same Resource Scheduler block, each sending a named agenda to the scheduler.) The Entity Type field under Search Targets By indicates which resource entities the associated agenda in the appointment applies to. For this model, the agenda that is created in the Resource Agenda block is activated at a Start Time of 0 (when the simulation run begins) and is applied to the BankTellers resource entity objects in the model. The Immediate Actions options selected here indicate that resource entities that are in a seized state are not preempted. For more information about preemption, see the section Preempting Resource Entities.
Figure 9.9: Resource Scheduler Block Properties Dialog Box
The final new block that is added to this resource model is the Resource Stats Collector block. This block collects statistics about resource entities during the simulation run. The Resource Stats Collector requires a minimum of two pieces of information: the resource entities that you want to collect statistics about and the statistics that you want to compute. The Resource Stats Collector Block Properties dialog box has separate tabs for you to enter this information. The Groups tab, as shown in Figure 9.10, identifies the targeted resource entities for statistics collection. In this example, resource entities of the BankTellers Entity Type have been targeted. The Statistics tab, as shown in Figure 9.11, specifies the statistics that you want to compute. For more information about the columns in this table, see the Resource Stats Collector block overview in Appendix A: Templates.
Figure 9.10: Groups Tab in Resource Stats Collector Block Properties Dialog Box
Figure 9.11: Statistics Tab in Resource Stats Collector Block Properties Dialog Box
In this example, two statistics are defined: Utilization and Idle. Both are computed using the %AvgAvail statistic type. For the statistic named Utilization, the Seized option is set to true. In this case, the result is the percentage of time that resource entities of type BankTellers are seized, relative to the time-average number of available units of resource entities of type BankTellers during the simulation run. For the statistics named Idle, the Seized option is set to false. In this case, the result is the percentage of time that resource entities of type BankTellers are not seized, relative to the time-average number of available units of resource entities of type BankTellers during the simulation run.
The Resource Stats Collector block provides an option to save the defined statistics to a file at the end of each run (that option was selected for this example). You can also attach a plot block to the OutData outport of the Resource Stats Collector block to display the statistics during the simulation run. In this example, a Table block displays the defined statistics. At the end of the run, the Utilization statistic equals 0.361853, and the Idle statistic equals 0.638147 (as shown in Figure 9.6).
This example provides a glimpse into the modeling capabilities and potential applications of the Resource Agenda, Resource Scheduler and Resource Stats Collector blocks. Although these blocks are more complex than many of the previously demonstrated blocks, they also provide powerful and flexible modeling functionality.