Suppose that you want to:
Preload a queue or server with entities at the start of the simulation, before you analyze queueing or processing delays.
Initialize the capacity of a shared resource before you analyze resource allocation behavior.
In these scenarios, you can simultaneously generate multiple entities at the start of the simulation. You can then observe the behavior of only those entities for the remainder of the simulation.
To generate multiple entities at time
use a Time-Based Function-Call Generator block in combination
with an Event-Based Entity Generator block. This approach
is shown in the following simple model.
Double-click the Time-Based Function-Call Generator block.
From the Event generation mode drop-down
Only at simulation start.
In the Number of simultaneous event repetitions
per period field, enter the number of entities that you
want to generate. For example, you could enter
In that case, at simulation time
0, the Time-Based
Function-Call Generator block generates
Double-click the Event-Based Entity Generator block.
From the Generate entities upon drop-down
Function call from port fcn.
In that case, for each function-call event that the Time-Based
Function-Call Generator generates at time
the Event-Based Entity Generator block generates an
In the preceding model, the output of the Instantaneous
Entity Counting Scope block shows that the software generates
multiple entities at time
This example shows a practical application of the procedure
for generating multiple entities at time
Suppose that you want to simulate a resource allocation problem, where
only a fixed number of operators are available to answer customer
calls in a call center. Whenever an operator is free, that operator
is allocated to a customer call. When the call is completed, the operator
is returned to the pool of available operators and the operator is
allocated to a new call. The duration of customer calls varies in
a random fashion. You want to analyze how frequently the number of
customer calls exceeds the number of available operators during a
particular time period.
To generate multiple entities at the simulation start, use a Time-Based Function-Call Generator block in combination with an Event-Based Entity Generator block. These entities proceed to a queue block that represents the queue of operators waiting to accept new calls.
The software generates
25 entities at time
The role of the Path Combiner block is to return an
operator to the queue each time that the operator completes a call.
A Time-Based Entity Generator block generates entities that represent new customer calls. These customer entities proceed immediately to a queue. An Entity Combiner block then combines entities from the customer queue with entities from the operator queue. This action represents the allocation of an available operator to a customer call.
The combined entities advance to an Infinite Server block that has a service time generated by a random number generator. This portion of the model simulates the servicing of the customer call.
When an operator completes a call, the Enitity Splitter block returns the entity that represents the operator to the queue to accept a new call. The entity representing the customer proceeds to an entity sink that represents the end of the call. The following graphic shows the complete model.
You can see the performance of the operators in completing customer calls from the output of the scope blocks that connect to the operator and customer queues.
The left-hand plot shows the changing number of entities in
the operator queue as the simulation progresses. At time
you can see that the software generates
These entities represent the entire pool of operators that is initially
available to accept customer calls. As each operator is allocated
to a customer call, the number of available operators decreases to
zero. Because the duration of each call is random, for the rest of
the simulation the number of available operators rises and falls.
The right-hand plot shows how the number of entities in the customer queue changes over the course of the simulation. By comparing the left-hand and right-hand plots, you can see that at the times when the number of available operators has decreased to zero, the number of customers waiting in the queue increases. This number decreases again when operators become available.