The model of retrial queuing system
The retrial queuing system in terms of queuing theory
Such a system is an advanced case of
M/M/C/K,T queuing system.
Entities also arrive at a common queue with FIFO discipline as a Poisson process.
The queue capacity is limited with
K waiting places.
The queue timeout (maximum waiting time) is exponentially distributed with
T mean value.
Entities from the queue are distributed between
C servers.
The service time value of all servers is exponentially distributed.
Free server is selected randomly.
But the considered queuing system model represents already real objects.
The difference from the M/M/C/K,T queuing system is that the entities rejected from the queue due to a timeout are split into two flows.
The entities of the first one are destroyed.
This simulates the losses, the entities (clients) that don't want to try again to get service.
The second flow entities are delayed for a time before they are forwarded to the queue.
This simulates the attempt of entities to get service again.
After a delay these entities are mixed with newly arrived entities, and together are passed on to the queue.
So, the mixed flow entering the queue is non-Markovian process, and, therefore, the designation of this system is
G/M/C/K,T queue.
G stands for general distribution.
The model of a G/M/C/K,T queuing system in terms of OpenSIMPLY
The Generator, Selector and Server blocks are used for this system description as for
M/M/C/K,T queuing model.
Instead of Queue block, the YQueue block with additional secondary output will be used in this model.
Through this output, entities rejected because of timeout are not destroyed, but are passed on further.
Additionally, the Mixer, Splitter, Terminal and InfiniteServer blocks will be used for this model.
The Mixer combines the entity flows from the multi-input.
The Splitter divides the entity flow from the input into two outputs according with the specified portion.
The Terminal just destroys the entities, it is an end station.
The InfiniteServer block accepts every entity and delays it for a specified time.
In Delphi and Free Pascal, these blocks are represented by the TGenerator, TMixer, TYQueue, TSelector, TServer, TSplitter, TTerminal, and TInfiniteServer classes, respectively.
Download executable model of the retrial G/M/C/K,T queuing system as a real call center.
Model creation
FIFO is the default discipline for the YQueue block, so it does not need to be specified explicitly.
The selection rule for the Selector block should be specified with the parameter RandomSelection, because the servers are searching randomly.
But this parameter can be omitted, and the default selection rule "First free selection" will be used instead, if only the queue probability, the mean waiting time or the mean queue length values are of interest.
The Gen, Mix, YQue, Sel, Splt, Trm and InfSrv variables will be used for the instances of the TGenerator, TMixer, TYQueue, TSelector, TSplitter, TTerminal and TInfiniteServer classes, respectively.
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, the array for a number of servers of a TServer type should not be created, and therefore no variable is required. The TServer class and the parameters will be specified in the Assign method of the TSelector.
Model parameters
- Capacity is the total number of entities for simulation.
- QueueCapacity is the number of waiting places in a queue.
- InterarrivalTime is mean value between entities arrivals.
- QueueTimeout is maximum waiting time in a queue.
- NumberOfServers is the total number of entities for simulation.
- ServiceTime is mean value of service time.
- ExpTime is a block function returning exponentially distributed random values.
- RetrialsPercentage is a percentage of timeout rejected entities trying to get service again.
- RetrialDelay is mean time an entity is waiting before the attempt to get service again.
Model behavior
The lines below fully describe the behavior of G/M/C/K,T retrial queuing system in terms of OpenSIMPLY:
Gen := TGenerator.Create([Capacity, ExpTime, InterarrivalTime]); // Creating a Generator.
Mix := TMixer.CreateDefault; // Creating a Mixer.
YQue := TYQueue.Create([QueueCapacity, ExpTime, QueueTimeout]); // Creating a YQueue.
Sel := TSelector.Create([NumberOfServers]); // Creating a Selector with default rule.
Splt := TSplitter.Create(RetrialsPercentage); // Creating a Splitter.
Trm := TTerminal.CreateDefault; // Creating a Terminal.
InfSrv := TInfServer.Create(ExpTime,RetrialDelay); // Creating an InfiniteServer.
Gen.Connect(Mix); // Connecting Generator to Mixer.
Mix.Connect(YQue); // Connecting Mixer to YQueue.
YQue.Connect(1, Sel); // Connecting YQueue to Selector.
YQue.Connect(2, Splt); // Connecting YQueue to Splitter.
Sel.Connect(1, NumberOfServers, TServer, [ExpTime, ServiceTime]); // Creating Servers and assigning them to Selector.
Splt.Connect(1, InfSrv); // Connecting Splitter to InfiniteServer.
Splt.Connect(2, Trm); // Connecting Splitter to Terminal.
InfSrv.Connect(Mix); // Connecting InfiniteServer to Mixer.
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 GUI}
{$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,
RetrialsPercentage,
RetrialDelay: Double;
procedure TMyModel.Body; // Model description.
var
Gen: TGenerator; // Blocks declaration.
Mix: TMixer;
YQue: TYQueue;
Sel: TSelector;
Splt: TSplitter;
Trm: TTerminal;
InfSrv: TInfServer;
begin
Gen := TGenerator.Create([Capacity, ExpTime, InterarrivalTime]);
Mix := TMixer.CreateDefault;
YQue := TYQueue.Create([QueueCapacity, ExpTime, QueueTimeout]);
Sel := TSelector.Create([NumberOfServers]);
Splt := TSplitter.Create(RetrialsPercentage);
Trm := TTerminal.CreateDefault;
InfSrv := TInfServer.Create(ExpTime, RetrialDelay);
Gen.Connect(Mix);
Mix.Connect(YQue);
YQue.Connect(1, Sel);
YQue.Connect(2, Splt);
Sel.Connect(1, NumberOfServers, TServer, [ExpTime, ServiceTime]);
Splt.Connect(1, InfSrv);
Splt.Connect(2, Trm);
InfSrv.Connect(Mix);
Run(Gen); // Launching the start block.
YQue.ShowStat; // Results.
end;
begin
Capacity := 3000; // Initial values of the model.
InterarrivalTime := 1;
QueueCapacity := 3;
QueueTimeout := 1;
ServiceTime := 1.3;
NumberOfServers := 2;
RetrialsPercentage := 20;
RetrialDelay := 0.16;
Simulate(TMyModel); // Starting a model.
end.