M/M/C queue system in terms of OpenSIMPLY.

M/M/C queue system M/M/C queue system is a classical example of queueing theory and traffic theory. The system consists of a single common queue with FIFO discipline and "C" servers. Entities are arrived as a Poisson process. Queue capacity and timeout (waiting time) are infinite. Service time value is exponentially distributed. Selection rule of free server has random selection.



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


It should be noted that for the practical purposes the M/M/C/K/T queue system instead of classical has to be used. Such system has a limited queue parameters capacity and/or timeout. This system can describe a lot of simple systems like barbershop, network distributor or phone mini exchange (PBX).

M/M/C/K/T queue system This system has a queue of capacity "K" with timeout "T" and FIFO discipline, selector, and array of "C"servers.




The simulation results of the classical example as well as of M/M/C/K/T queue system can be checked with the analytical formula of traffic theory. So the probability of the queue can be obtained with Erlang C formula. Of course, for the M/M/C/K/T queue system the values of capacity and timeout have to be specified (in the simulation model) large enough to fit the concept of infinite values of queue parameters.

Model parameters

  • Capacity is the total number of entities for simulation.
  • QCapacity is the number of waiting places. For M/M/C queue is infinite.
  • Timeout is the maximum waiting time. For M/M/C queue is infinite.
  • ServersNumber is the number serves.
  • lambda is mean value between entities arrivals.
  • mu is mean value of service time.
  • ExpTime is the block parameter for function returning exponentially distributed random values.
  • RandomSelection is the block parameter for selection rule based on an random selection.

For assignment of instances for classes TGenerator, TQueue and TSelector, the variables "Gen", "Que" and "Sel" will be used accordingly. An array of variables for TServer is not needed. TSelector can create specified block type and assign created instance to selection points automatically.

Model behavior

Gen:=TGenerator.Create([Capacity,ExpTime,lambda]); // Creation of TGenerator instance.

Que:=TQueue.Create([QCapacity,Timeout]); // Creation of TQueue instance.

Sel:=TSelector.Create([ServersNumber,RandomSelection]); // Creation of TSelector instance.

Gen.Next:=Que; // Connection of of block "Gen" to block "Que".

Que.Next:=Sel; // Connection of of block "Que" to block "Sel".

Sel.Assign(1,ServersNumber,TServer,[ExpTime,mu]); // Creation of TServer instances and assigning them to Sel.




For compiling and receiving of executable file, the code of model behaviour has to be placed into the standard model wrapper as in M/M/1 system example.

Complete program code containing input data and output of results.

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

uses
  SimBase,
  SimBlocks,
  SimStdGUI;
  
type
  TMyModel = class(TModel)             //  Model declaration.  
    procedure Body; override;
  end;	
                                       //  Global variables of the model.
var                                   
  Capacity, QCapacity, ServersNumber: integer;
  lambda, mu, Timeout: Double;
 
procedure TMyModel.Body;               //  Model description
var                                    
  Gen: TGenerator;                     //
  Que: TQueue;                         // Model variables. 
  Sel: TSelector;                      //  
begin                                   
  Gen:=TGenerator.Create([Capacity,ExpTime,lambda]);         // 
  Que:=TQueue.Create([QCapacity,Timeout]);                   // 
  Sel:=TSelector.Create([ServersNumber,RandomSelection]);    // Model behavior.
  Gen.Next:=Que;                                             // 
  Que.Next:=Sel;                                             // 
  Sel.Assign(1,ServersNumber,TServer,[ExpTime,mu]);          //   
  
  Run(Gen);                            //  Starting of initial block.
   
                                       //  Outputting of results.
  with Que do 
    OutTextRealLn('Queue probability',DelayedCount/Count);  
end;

begin   
  Capacity:=3000;                      // Initial values of the model.
  lambda:=1;                           //
  mu:=1.3;                             //
  ServersNumber:=2;                    //
  QCapacity:=100;                      // (for M/M/1 queue it is infinite)  
  Timeout:=300;                        // (for M/M/1 queue it is infinite)
 
  Simulate(TMyModel);                  //  Starting of the model.
end.  
      


To verify the model the simulation results of M/M/1 system can be checked with analytics of traffic theory.
The queue probability can be obtained with Erlang_C formula.
OpenSIMPLY tutorial contains the practical examples with detailed description.
Discrete event simulation software OpenSIMPLY is absolutely free. Try it. Free download. Free use.