Browser width
is too narrow.

Rotate the screen
or increase
the width.
OpenSIMPLY Free open source simulation software
▲

M/M/c/K Queue with Reneging Simulation Model

Theoretical Background

This queuing system is already able to represent real-world systems.

Such a system is a special case of the M/M/c/K system.

What remains the same as in the M/M/c/K:
  • Entities arrive at the queue according to a Poisson process and are served in FIFO order.
  • The queue capacity is finite, and if the queue is full, arriving entities are lost (blocked).
  • Entities from the queue are assigned to one of the C servers.
  • If an idle server is found, the entity is passed to it, otherwise the entity is placed in a queue.
  • If several servers are idle, one of them is selected at random.
  • The service time of any server is exponentially distributed.


The key difference is that the queue timeout (waiting time) is finite.

If an entity waiting in the queue exceeds the timeout, it leaves the queue (reneges) and is lost.

Therefore, this system is called a queue with reneging.

The characteristics under study are the blocking probability, probability of waiting, mean waiting time, and mean queue length.

Since the method of selecting an idle server does not affect the characteristics of interest, any selection rule can be applied (not necessarily random).
M/M/c/K queue with reneging

Model in OpenSIMPLY

This model uses the same blocks as the M/M/c/K model: Generator, Queue, Selector and Server.

The TQueue Create constructor uses the second and the third items in the Initial Values parameter to specify the queue timeout.
  • The second item – Timeout function – determines the timeout.
  • The third item specifies the parameter of that function.


Since you can specify the queue capacity and queue timeout in the InitialValues parameter, the same TQueue class is used to simulate a queue with limited capacity and finite timeout.

Since FIFO is the default discipline for the Queue block, it does not need to be specified explicitly.

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 with reneging, representing an almost real call center.
OpenSIMPLY block model of the M/M/c/K queue with reneging

Model Creation

The QueueTimeout variable will be used to specify the queue timeout.

Assume the timeout in this model is exponentially distributed. Use the ExpTime time function to specify it (the same as for the Generator block).

The Connection Rule item of the Initial Values parameter for the TSelector class should be specified as RandomConnection. However, because the method of selecting an idle server does not affect the results, the default FirstIdleConnection value can be used instead. Therefore, this parameter can be omitted.

The TSelector Connect method is used in the same way as in the M/M/c model.

Let's use the variables Gen, Que, and Sel for the instances of the TGenerator, TQueue, and TSelector classes, respectively.

Model Parameters

The following variables and constants will be used for the Initial Values of the blocks.
  • TotalEntities — the total number of entities to be simulated during the model run.
  • QueueCapacity — the number of waiting places in the queue.
  • QueueTimeout — the maximum waiting time for an entity in the queue.
  • NumberOfServers — the number of servers in the system.
  • InterarrivalTime — the mean time between entity arrivals.
  • ServiceTime — the mean service time.
  • ExpTime — a pointer to a function that returns exponentially distributed random values.

Model Behavior

The code below defines the behavior of the M/M/c/K system with reneging as an OpenSIMPLY model.

Gen := TGenerator.Create([TotalEntities, ExpTime, InterarrivalTime]);    //  Creating Generator.

Que := TQueue.Create([QueueCapacity, ExpTime, QueueTimeout]);            //  Creating limited capacity Queue with limited timeout.

Sel := TSelector.Create([NumberOfServers]);                              //  Creating 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 model wrapper.
 

Complete Program Code with Input Data and Results

program MMCKreneging;
{$apptype xxx }  // xxx "GUI" or "Console" 
{$S-}
uses
  SimBase,
  SimBlocks,
  SimStdGUI;
  
type
  TMyModel = class(TModel)             //  Model declaration.  
    procedure Body; override;
  end;

var                                    //  Model parameters.
  TotalEntities,                       
  QueueCapacity,
  NumberOfServers: Integer;
  InterarrivalTime,
  QueueTimeout,
  ServiceTime: Double;
 
procedure TMyModel.Body;               //  Model behavior.
var                                    
  Gen: TGenerator;                     //  Blocks declaration.
  Que: TQueue;   
  Sel: TSelector;
begin 
  Gen := TGenerator.Create([TotalEntities, ExpTime, InterarrivalTime]);
  Que := TQueue.Create([QueueCapacity, ExpTime, QueueTimeout]);
  Sel := TSelector.Create([NumberOfServers]); 
  Gen.Connect(Que);
  Que.Connect(Sel);
  Sel.Connect(1, NumberOfServers, TServer, [ExpTime, ServiceTime]);  

  Run(Gen);                            //  Launching start block.
                                       
                                       //  Results.
                                       
  Gen.ShowStats;                       //  Blocking probability
  
  Que.ShowStats;                       //  Probability of waiting,
                                       //  mean waiting time, mean queue length
end;

begin
  TotalEntities := 3000;               //  Initial values of model.
  InterarrivalTime := 1;
  QueueCapacity := 3;
  QueueTimeout := 1 ;
  ServiceTime := 1.3;
  NumberOfServers := 2;

  Simulate(TMyModel);                  //  Starting model.
end.


The M/M/c/K model with reneging is more realistic than the M/M/c/K model, but it applies only to certain cases.

See also:
This system can be used to simulate a real-world call center.