Simulation model of the M/M/C/K,T queuing system
The M/M/C/K,T queuing system in terms of queuing theory
This queuing system can already represent the real objects.
Such system is a degenerated case of the
M/M/C queuing system.
Entities arrive at a queue with
FIFO discipline according to a Poisson process.
Entities from the queue are also distributed between
C servers.
The service time value of all servers is exponentially distributed.
Free server is selected randomly.
The difference is that the queue capacity (the number waiting places) is not infinite, but limited with
K places;
the queue waiting timeout (maximum waiting time in the queue) is not infinite, but has a certain value
T.
The characteristics under study are the
queue probability,
mean waiting time and
mean queue length.
Since how an idle server is selected does not affect the characteristics of interest, this rule can be any, not necessarily random.
The M/M/C/K,T queuing model in terms of OpenSIMPLY
The Generator, Queue, Selector and Server blocks are used for this system description
as for
M/M/C queuing system.
In Delphi and Free Pascal, these blocks are represented by the classes TGenerator, TQueue, TSelector and TServer, respectively.
Download executable model of the
M/M/C/K,T queuing system as almost real call center.
Model creation
The FIFO is a default discipline for the Queue block, and therefore that must not be specified explicitly.
The сonnection rule item of the Selector block parameter should be specified with the RandomConnection value.
But, based on remark above, the default FirstIdleConnection value can used instead.
Therefore, this parameter can be omitted.
Since the Selector block can create the specified number of instances of the block of the specified type and automatically assign them to the selection points, it should not create the TServer type array for a number of servers; and the variable for it is not required.
So, only the variables Gen, Que and Sel will be used for the instances of the classes TGenerator, TQueue and TSelector, respectively.
The TServer class and server parameters will be specified as parameters in the Assign method of the TSelector.
Model parameters
The following variables and functions will be used for the initial values of the blocks.
- Capacity: to specify the total number of entities for simulation (Generator)
- QueueCapacity: to specify the number of waiting places for entities (Queue)
- QueueTimeout: to specify the maximum waiting time for an entity (Queue)
- NumberOfServers: to specify the number of servers in the system (Selector)
- InterarrivalTime: to specify the mean value between entities arrivals (Generator)
- ServiceTime: to specify the mean value of service time (Server)
- ConstantTime: a block function that returns the specified constant value
- ExpTime: a block function that returns exponentially distributed random values
Model behavior
The lines below fully describe the behavior of
M/M/C/K,T queuing system in terms of OpenSIMPLY:
Gen := TGenerator.Create([Capacity, ExpTime, InterarrivalTime]); // Creating a Generator.
Que := TQueue.Create([QueueCapacity, ConstantTime, QueueTimeout]); // Creating a limited capacity Queue with limited timeout.
Sel := TSelector.Create([NumberOfServers]); // Creating a Selector with default rule.
Gen.Connect(Que); // Connecting Generator to Queue.
Que.Connect(Sel); // Connecting Queue to Selector.
Sel.Connect(1, NumberOfServers, TServer, [ExpTime, ServiceTime]); // Creating Servers and assigning them to Selector.
To compile a model, the code above should be placed in a
standard wrapper of a model.
Complete program code containing input data and output of results.
program MMCKTqueue;
{$apptype xxx } // xxx "GUI" or "Console"
{$S-}
uses
SimBase,
SimBlocks,
SimStdGUI;
type
TMyModel = class(TModel) // Model declaration.
procedure Body; override;
end;
var
Capacity, // Model parameters.
QueueCapacity,
NumberOfServers: Integer;
InterarrivalTime,
QueueTimeout,
ServiceTime: Double;
procedure TMyModel.Body; // Model description.
var
Gen: TGenerator; // Blocks declaration.
Que: TQueue;
Sel: TSelector;
begin
Gen := TGenerator.Create([Capacity, ExpTime, InterarrivalTime]);
Que := TQueue.Create([QueueCapacity, ConstantTime, QueueTimeout]);
Sel := TSelector.Create([NumberOfServers]);
Gen.Connect(Que);
Que.Connect(Sel);
Sel.Connect(1, NumberOfServers, TServer, [ExpTime, ServiceTime]);
Run(Gen); // Launching the start block.
Que.ShowStat; // Results.
end;
begin
Capacity := 3000; // Initial values of the model.
InterarrivalTime := 1;
QueueCapacity := 3;
QueueTimeout :=1 ;
ServiceTime := 1.3;
NumberOfServers := 2;
Simulate(TMyModel); // Starting a model.
end.
The model of the M/M/C/K,T queuing system is much more realistic as the
M/M/C queuing system, but fit only some cases.
See the model of the
G/M/C/K,T queuing system (retrial system), that can be used to simulate a real call center.