Rotate the screen

Model of M/M/C queue

M/M/C queue system in terms of quequeing theory

M/M/C queue system is a classical example of queueing theory and traffic theory.

Entities are arrived as a Poisson process to the common queue with FIFO discipline. Queue capacity and timeout (maximum waiting time) are infinite. The enities from the queue are distributed between C servers. Free server selection rule has a random selection.

Formally, because the kind of selection rule does not touch such characteristics as queue probability, mean waiting time or mean queue length, selection rule can of any kind. Service time value of all servers is exponentially distributed.

Watch the learning video about M/M/c queue system.
M/M/C queue

M/M/C queue system in terms of OpenSIMPLY

For description of this system the blocks "Generator", "Queue", "Selector" and "Server" are needed.

In Delphi and FreePascal the corresponding classes "TGenerator", "TQueue", "TSelector" and "TServer" will be used.

Block Selector distributes the entities between the servers. This block selects a free server in accordance with the specified selection rule and forward entity to this server.

Download executable model of M/M/C queue system as an ideal call center.
M/M/C queue block model

Model creation

FIFO is a default discipline for the "TQueue" block, and therefore that must not be specified explicitly.

The rule for "Selector" should be specified with the parameter "RandomSelection". But, based on the aforementioned remark, this parameter can be omitted, and the default selection rule "First free selection" will be used instead.

Normally, for a row of servers an array of "TServer" should be created. 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 of "TServer" array is required.

Thus, only the variables "Gen", "Que" and "Sel" will be used for instances of classes "TGenerator", "TQueue" and "TSelector" accordingly. The "TServer" class and server parameters will be specified as parameters for the "TSelector" block .

Model parameters

  • Capacity is the total number of entities for simulation.
  • NumberOfServers 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 model behaviour for M/M/C queue 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.Next:=Que;                                                  //  Connecting Generator to Queue.

Que.Next:=Sel;                                                  //  Connecting Queue to Selector.

Sel.Assign(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 as in M/M/1 loss system example.

Download already compiled executable model of M/M/C queue built with OpenSIMPLY.

Complete program code containing input data and output of results.

program MMCqueue;
{$apptype xxx }  // xxx "GUI" or "Console" 

  TMyModel = class(TModel)             //  Model declaration.  
    procedure Body; override;
  Capacity,                            //  Model parameters.
  NumberOfServers: integer;             
  ServiceTime: Double;                  
procedure TMyModel.Body;               //  Model description.
  Gen: TGenerator;                     //  Blocks declaration.
  Que: TQueue;   
  Sel: TSelector;
  Run(Gen);                            //  Starting an initial block.
  Que.ShowStat;                        //  Outputting results.  

  Capacity:=3000;                      //  Initial values of the model.

  Simulate(TMyModel);                  //  Starting a model.

To validate the model of M/M/C queue system, simulation results can be verified using traffic theory analytics.
The value of queue probability can be obtained by the Erlang_C formula.

It should be noted that for the practical purposes the classical M/M/C queue 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.
And, the M/M/C/K,T queue system with a certain capacity and limited timeout should to be used instead.
Such a model can be used to simulate a large number of simple systems like barbershop, easy call center etc.