Rotate the screen

Model of M/M/C/K,T queue

M/M/C/K,T queue system in terms of quequeing theory

The M/M/C/K,T queue system as almost a real-life model. This system is a special case of M/M/C queue system. Entities are also arrived as a Poisson process to the common queue. Queue discipline is FIFO too. The enities from the queue are also distributed vie selector between C servers. Free server also is searching randomly. And the service time value is also exponentially distributed.

The difference is that a queue is not infinite, but limited with capacity K and timeout (maximum waiting time) T.
M/M/C/K,T queue

M/M/C/K,T queue system in terms of OpenSIMPLY

For description of this system only the same "Generator", "Queue", "Selector" and "Server" blocks are needed as for M/M/C queue system.

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/K,T queue system as an almost real call center.
M/M/C/K,T 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", because the servers are searching randomly. But this parameter can be omitted, and the default selection rule "First free selection" will be used instead if queue probability, mean waiting time or mean queue length characteristics are interesting only.

Normally, for Because "Selector" block can create the specified number of instances of the specified block type and automatically assign them to the selection points, an array of "TServer" for a row of servers should not be created; and no variable of "TServer" array is required.

Thus, only the variables "Gen", "Que" and "Sel" will be used for instances of the "TGenerator", "TQueue" and "TSelector" classes 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.
  • QueueCapacity is the number of waiting places in a queue.
  • InterArrivalTime is mean value between entities arrivals.
  • QueueTimeout is maximum waiting time in a queue.
  • NumberOfServers is the total number of entities for simulation.
  • ServiceTime is mean value of service time.
  • ExpTime is a block function returning exponentially distributed random values.
  • ConstantTime is a block function returning every time the same constant value.

Model behavior

The lines below fully describe the model behaviour for M/M/C/K,T queue system in terms of OpenSIMPLY:

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

Que:=TQueue.Create([QueueCapacity,ConstantTime,QueueTimeout]);  //  Creating a Queue with constant timeout.

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/K,T queue built with OpenSIMPLY.

Complete program code containing input data and output of results.

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

uses
  SimBase,
  SimBlocks,
  SimStdGUI;
  
type
  TMyModel = class(TModel)             //  Model declaration.  
    procedure Body; override;
  end;

var
  Capacity,                            //  Model parameters.
  QueueCapacity,           
  NumberOfServers: integer;
  InterArrivalTime,        
  QueueTimeout,            
  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.Create([QueueCapacity,ConstantTime,QueueTimeout]);
  Sel:=TSelector.Create([NumberOfServers]); 
  Gen.Next:=Que;
  Que.Next:=Sel;
  Sel.Assign(1,NumberOfServers,TServer,[ExpTime,ServiceTime]);  
  
  Run(Gen);                            //  Starting an initial block.
                                       
  Que.ShowStat;                        //  Outputting results.
end;

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

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