M/M/∞ Queue Simulation Model
Theoretical Background
The
M/M/∞ system is a classic example in queueing theory and can be viewed as the limiting case of the
M/M/c system as the number of servers approaches infinity.
Entities arrive at the queue according to a Poisson process and are served in
FIFO order.
Queue
capacity and timeout are infinite.
Entities are assigned to an
infinite number of servers.
In this system, an idle server is always available for an arriving entity.
Therefore, entities are never delayed, and the queue length remains zero.
One of several idle servers is selected randomly.
The service time of any server is exponentially distributed..
The key metric under study is the
mean number of entities in the system (which equals the mean number of busy servers),
while the mean queue length remains zero.
Model in OpenSIMPLY
Similar to the
M/M/1 model,
this model requires the Generator and Queue blocks.
However, the
Infinite Server block is used to simulate entity service in the
M/M/∞ system
instead of the Server block in the
M/M/1.
Unlike the
M/M/c model, no Selector block is required
in this case.
In Delphi and Free Pascal, these blocks are represented by the
TGenerator,
TQueue and
TInfServer classes, respectively.
Model Creation
FIFO is the default discipline of the Queue block and does not need to be specified explicitly.
Thus, only the variables Gen, Que and InfSrv will be used for the instances of the classes
TGenerator, TQueue and TInfServer, respectively.
Model Parameters
The following variables and constants will be used for the
Initial Values of the blocks.
TotalEntities — the total number of entities to be simulated during the model run.
InterarrivalTime — the mean time between entity arrivals.
ServiceTime — the mean service time.
ExpTime — a pointer to a function that returns exponentially distributed random values.
Model Behavior
The code below defines the behavior of the
M/M/∞ system as an OpenSIMPLY model.
Gen := TGenerator.Create([TotalEntities, ExpTime, InterarrivalTime]); // Creating Generator.
Que := TQueue.CreateDefault; // Creating Queue with default initial values.
InfSrv := TInfServer.Create(ExpTime, ServiceTime); // Creating Infinite Server.
Gen.Connect(Que); // Connecting Generator to Queue.
Que.Connect(InfSrv); // Connecting Queue to Infinite Server.
To compile a model, the code above should be placed in a
standard model wrapper.
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 // Model parameters.
TotalEntities: Integer;
InterarrivalTime,
ServiceTime: Double;
procedure TMyModel.Body; // Model behavior.
var
Gen: TGenerator; // Blocks declaration.
Que: TQueue;
InfSrv: TInfServer;
begin
Gen := TGenerator.Create([TotalEntities, ExpTime, InterarrivalTime]);
Que := TQueue.CreateDefault;
InfSrv := TInfServer.Create(ExpTime, ServiceTime);
Gen.Connect(Que);
Que.Connect(InfSrv);
Run(Gen); // Launching start block.
// Results.
InfSrv.ShowStats; // Mean number of entities in the system
end;
begin
TotalEntities := 3000; // Initial values of model.
InterarrivalTime := 1;
ServiceTime := 1.3;
Simulate(TMyModel); // Starting model.
end.
In practice, the
M/M/∞ model serves as a useful theoretical benchmark.
Although no real system has an infinite number of servers, this model is often used when customers do not wait.
See also:
- the model of an M/M/c with a limited number of servers,
which is a bit more realistic.