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 should to be used. Such system has a queue with limited values for capacity and timeout. With this system a lot of simple systems like barbershop, network distributor or mini PBX can be described.

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.

Model parameters

  • Capacity is the total number of entities for simulation.
  • NumberOfServers is the number serves.
  • InterArrivalTime is mean value between entities arrivals.
  • ServiceTime 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.

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 instances to selection points automatically.

Model behavior

Gen:=TGenerator.Create([Capacity,ExpTime,InterArrivalTime]);    // Creating TGenerator instance.

Que:=TQueue.CreateDefault;                                      // Creating TQueue instance with default parameters.

Sel:=TSelector.Create([NumberOfServers,RandomSelection]);       // Creating TSelector instance.

Gen.Next:=Que;                                                  // Connecting the "Gen" block to the "Que" block.

Que.Next:=Sel;                                                  // Connecting the "Que" block to the "Sel" block.

Sel.Assign(1,NumberOfServers,TServer,[ExpTime,ServiceTime]);    // "Sel" creates TServer instances and assigns them to itself.

To compile a model, the code above should be placed in a standard wrapper of a model 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" 

  TMyModel = class(TModel)             //  Model declaration.  
    procedure Body; override;
                                       //  Global variables of the model.
  Capacity, QCapacity, NumberOfServers: integer;
  lambda, mu, Timeout: Double;
procedure TMyModel.Body;               //  Model description
  Gen: TGenerator;                     //
  Que: TQueue;                         // Model variables. 
  Sel: TSelector;                      //  
  Gen:=TGenerator.Create([Capacity,ExpTime,InterArrivalTime]);  // 
  Que:=TQueue.CreateDefault;                                    // 
  Sel:=TSelector.Create([NumberOfServers,RandomSelection]);     // Model behavior.
  Gen.Next:=Que;                                                // 
  Que.Next:=Sel;                                                // 
  Sel.Assign(1,NumberOfServers,TServer,[ExpTime,ServiceTime]);  //   
  Run(Gen);                            //  Starting of initial block.
                                       //  Outputting of results.
  OutTextRealLn('Queue probability',Que.QueueProbability);    

  Capacity:=3000;                      // Initial values of the model.
  InterArrivalTime:=1;                 //
  ServiceTime:=1.3;                    //
  NumberOfServers:=2;                  //

  Simulate(TMyModel);                  //  Starting of the 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.

The OpenSIMPLY tutorial will help you quickly get started. The tutorial contains practical examples with detailed descriptions.

The project documentation is available in different formats and compatible with any IDE.

Discrete event simulation software OpenSIMPLY is free and open source. Free download. Free use. Try it.