M/M/∞ Queue Simulation Model
M/M/∞ Queue: Theoretical Background
This system is a classic example of queuing theory, and is a modified case of the
M/M/1 queue.
Entities arrive at a queue with
FIFO discipline according to a Poisson process.
Queue
capacity and timeout are infinite.
Entities from the queue are distributed between
infinite number of servers.
If an idle server is found, the entity is passed to it, otherwise the entity is placed in a queue.
One of several idle servers is selected randomly.
The service time value of any server is exponentially distributed.
The characteristics under study are the
mean number of entities in the system, the
mean number of busy servers and the
mean queue length.
M/M/∞ Model in OpenSIMPLY
The Generator, Queue and Infinite Server blocks are used to describe this system.
In Delphi and Free Pascal, these blocks are represented by the TGenerator, TQueue and TInfiniteServer classes, respectively.
Model Creation
The FIFO is a default discipline for the Queue block as it is assumed in Queuing Theory, and therefore that must not be specified explicitly.
Thus, only the variables Gen, Que and InfSrv will be used for the instances of the classes TGenerator, TQueue and TInfiniteServer, respectively.
Model Parameters
The following variables and functions will be used for the initial values of the blocks.
- Capacity: to specify the total number of entities for simulation (Generator)
- InterarrivalTime: to specify the mean value between entities arrivals (Generator)
- ServiceTime: to specify the mean value of service time (Server)
- ExpTime: a block function that returns exponentially distributed random values
Model Behavior
The code below defines the behavior of the
M/M/∞ queue as an OpenSIMPLY model.
Gen := TGenerator.Create([Capacity, ExpTime, InterarrivalTime]); // Creating a Generator.
Que := TQueue.CreateDefault; // Creating an infinite FIFO Queue.
InfSrv := TInfServer.Create(ExpTime, ServiceTime); // Creating an Infinite Server.
Gen.Connect(Que); // Connecting the Generator to the Queue.
Que.Connect(InfSrv); // Connecting the Queue to the Infinite Server.
To compile a model, the code above should be placed in a
standard wrapper of a model.
Complete Program Code with Input Data and Results
program MMInf;
{$AppType GUI}
{$S-}
uses
SimBase,
SimBlocks,
SimStdGUI;
type
TMyModel = class(TModel) // Model declaration.
procedure Body; override;
end;
var
Capacity: Integer; // Model parameters.
InterarrivalTime,
ServiceTime: Double;
procedure TMyModel.Body; // Model behavior.
var
Gen: TGenerator; // Blocks declaration.
Que: TQueue;
InfSrv: TInfServer;
begin
Gen := TGenerator.Create([Capacity, ExpTime, InterarrivalTime]);
Que := TQueue.CreateDefault;
InfSrv := TInfServer.Create(ExpTime, ServiceTime);
Gen.Connect(Que);
Que.Connect(InfSrv);
Run(Gen); // Launching the start block.
Que.ShowStat; // Results.
InfSrv.ShowStat;
end;
begin
Capacity := 3000; // Initial values of the model.
InterarrivalTime := 1;
ServiceTime := 1.3;
Simulate(TMyModel); // Starting a model.
end.
It should be noted that for the practical purposes the
M/M/∞ queue cannot be used.
There is no real system where the number of servers is infinite.
See the model of an
M/M/c queue with a limited number of servers, which a bit more realistic.