Browser width is too narrow.

Rotate the screen or increase the width.
▲

The model of the M/M/1 queuing system

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

It is a classical example of queuing theory. The system consists of a queue with the FIFO discipline and an single server. Entities arrive at a queue as a Poisson process, then pass the queue and are forwarded to the server.

The service time value is exponentially distributed. Queue capacity and timeout (waiting time) are infinite. Queue discipline in the classical M/M/1 queueing system is the FIFO. Formally, the correct notation should be: M/M/1 FIFO queuing system.

The queue discipline determines the processing for the entities arriving to waiting line input and requests for entities from the output. In case of M/M/1 queuing system the idle server informs the queue about its status, and if the queue is not empty, the certain entity according with the queue discipline is forwarded further to the server.

FIFO queue discipline

FIFO stands for "First-In, First-Out". This means that the entity first placed in the queue is the first to be retrieved from the queue for servicing.

Watch the learning video about the M/M/1 queuing system.
The M/M/1 queuing

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

This example is only a bit more complicated than the M/M/1 loss system example. In addition to the Generator block for entity generation and the Server block for entity delay (serving), the M/M/1 queuing system model requires the Queue block for the queue discipline simulation.

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

Download executable models of queuing theory and call centers.
The M/M/1 queuing system block model

Model creation

The variables Gen, Que and Srv will be used for instances of the classes TGenerator, TQueue and TServer, respectively.

The default values for the Queue block for capacity and timeout is "Infinite capacity" and "Infinite timeout". The default value of queue discipline for the Queue block is FIFO. Therefore, when creating the Queue it is not necessary to explicitly specify the initial parameters.

Model parameters

  • Capacity is the total number of entities for simulation.
  • InterarrivalTime is mean value between entities arrivals.
  • ServiceTime is mean value of service time.
  • ExpTime is a block function returning exponentially distributed random values.

Model behavior

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

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

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

Srv := TServer.Create([ExpTime, ServiceTime]);                     //  Creating a Server.

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

Que.Connect(Srv);                                                  //  Connecting Queue to Server.


To compile a model, the code above should be placed in a standard wrapper of a model as in the M/M/1 system example.

Complete program code containing input data and output of results.

program MM1queue;
{$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.  
  NumberOfServers: Integer;
  InterarrivalTime,
  ServiceTime: Double;

procedure TMyModel.Body;       //  Model description.
var                            
  Gen: TGenerator;             //  Blocks declaration. 
  Que: TQueue;  
  Srv: TServer; 
begin                          //  Model behavior.

  Gen := TGenerator.Create([Capacity, ExpTime, InterarrivalTime]);
  Que := TQueue.CreateDefault;                 
  Srv := TServer.Create([ExpTime, ServiceTime]);
  Gen.Connect(Que);
  Que.Connect(Srv);

  Run(Gen);                    //  Launching the start block.

  Que.ShowStat;                //  Results.
end; 

begin
  Capacity := 3000;            //  Initial values of the model.
  InterarrivalTime := 1;
  ServiceTime := 1.3;
  
  Simulate(TMyModel);          //  Starting a model.
end.


To validate the M/M/1 queuing system model, the simulation results can be verified using the exact formula.

The value of queue probability can be obtained with Erlang-C formula.