Browser width
is too narrow.

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

Simulation model of the M/M/C queuing system

The M/M/C queuing system in terms of queuing theory

This system is a classic example of queuing theory and traffic theory.

This is a particular case of the M/M/∞ queuing system.

Entities arrive at a queue with FIFO discipline according to a Poisson process.

Queue capacity and queue timeout are infinite.

Entities from the queue are distributed between C servers.

If an idle server is found, the entity is passed to it, otherwise the entity is placed in a queue.

One of several idle servers is selected randomly.

The service time value of any server is exponentially distributed.

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.

Watch the learning video about the M/M/C queuing system.
 
M/M/C queuing system

The M/M/C queuing model in terms of OpenSIMPLY

The blocks Generator, Queue, Selector and Server are required to describe the model of this system.

In Delphi and Free Pascal, these blocks are represented by the TGenerator, TQueue, TSelector and TServer classes, respectively.

The Generator and Server blocks are described in the M/M/1 loss model example, the Queue block is described in the M/M/1 queue model example.

In the model under consideration, the Selector block is introduced.

Selector block

The Selector block distributes the entities arriving at the input of this block between the outputs (connection points) in accordance with the specified connection rule.

The outputs are connected to the blocks. In this example these are the Server blocks.

A block can be idle or busy. If there are at least two idle blocks, the connection rule determines which output should be connected the input to pass the entity.

Download executable model of the M/M/C queuing system as an ideal call center.
 
OpenSIMPLY block simulation model of the M/M/C queuing system

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.

Normally, the array of TServer should be created for the servers. But the Selector block can create the specified number of instances of the specified block type and automatically assign them to the selection points. That means no variable for array of the TServer is required.

Thus, 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 initial values will be specified as parameters for the TSelector block .

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)
  • 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)
  • ExpTime: a block function that returns exponentially distributed random values

Model behavior

The lines below fully describe the model behavior of M/M/C queuing system in terms of OpenSIMPLY:

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

Que := TQueue.CreateDefault;                                        //  Creating an infinite FIFO Queue.

Sel := TSelector.Create([NumberOfServers]);                         //  Creating a Selector with default rule.

Gen.Connect(Que);                                                   //  Connecting the Generator to the Queue.

Que.Connect(Sel);                                                   //  Connecting the Queue to the Selector.

Sel.Connect(1, NumberOfServers, TServer, [ExpTime, ServiceTime]);   //  Creating the Server instances and
                                                                    //  assigning them to the 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 MMCqueue;
{$AppType GUI}
{$S-}
uses
  SimBase,
  SimBlocks,
  SimStdGUI;
  
type
  TMyModel = class(TModel)             //  Model declaration.  
    procedure Body; override;
  end;

var
  Capacity,                            //  Model parameters.
  NumberOfServers: Integer;
  InterarrivalTime,
  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.CreateDefault;
  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;
  ServiceTime := 1.3;
  NumberOfServers := 2;

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


To validate the M/M/C queuing system model, the simulation results can be verified using the exact formula. The value of queue probability can be obtained by the Erlang C formula.

It should be noted that for the practical purposes the M/M/C queuing system cannot be used. There is no real system where the number of waiting places is infinite, or a client can wait for a service indefinitely. See more realistic model of the M/M/C/K,T queuing system with limited capacity and timeout. Such a model can be used to simulate a large number of simple systems like barbershop, easy call center etc.