M/M/C queue system in terms of OpenSIMPLY.
M/M/C queue system is a classical example of queueing theory. The system consists of a single common queue with FIFO discipline and "C" servers. The stream of arrived entities represents the Poisson process. The queue capacity and timeout (waiting time) are infinite. The serving time of the server is an exponentially distributed value. The selection rule of the free server is a 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. This system can describe a lot of simple systems like barbershop, network distributor or mini phone exchange.
This system has a queue with the capacity for "
K" waiting places with timeout "
T" with FIFO discipline, selector of entities with acceding selection rule (from first selection point), and an 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.
The parameters that will be used in the model

Capacity is the total number of entities for simulation.

QCapacity is the number of waiting places. In the classical example is infinite.

Timeout is the maximum waiting time. In the classical example is infinite too.

ServersNumber is the mean value of arrived entities stream.

lambda is the number of servers.

mu is the mean value of service time.

ExpTime is the builtin function for exponentially distributed random values.

RandomSelection is the builtin function for random selection of assigned blocks.
The model of M/M/C queue system in terms of OpenSIMPLY:
Gen:=TGenerator.Create([Capacity,ExpTime,lambda]);
Que:=TQueue.Create([QCapacity,Timeout]);
Sel:=TSelector.Create([ServersNumber,RandomSelection]);
Gen.Next:=Que;
Que.Next:=Sel;
Sel.Assign(1,ServersNumber,TServer,[ExpTime,mu]);
To compile your model for receiving the executing file, the code of the model description has to be placed in the standard model wrapper that is the same for practically any model.
The complete program code containing the input data and the output of the results.
program MMCqueue;
{$apptype xxx } // xxx "GUI" or "Console"
uses
SimBase,
SimBlocks,
SimStdGUI;
type
TMyModel = class(TModel) // Model declaration.
procedure Body; override;
end;
var // Global variables of the model.
Capacity,
QCapacity,
ServersNumber: integer;
lambda,
mu,
Timeout: Double;
procedure TMyModel.Body; // Model description
var // Block variables
Gen: TGenerator;
Que: TQueue;
Sel: TSelector;
begin
// Model behavior
Gen:=TGenerator.Create([Capacity,ExpTime,lambda]);
Que:=TQueue.Create([QCapacity,Timeout]);
Sel:=TSelector.Create([ServersNumber,RandomSelection]);
Gen.Next:=Que;
Que.Next:=Sel;
Sel.Assign(1,ServersNumber,TServer,[ExpTime,mu]);
// Starting of initial block.
Run(Gen);
// Outputting of the simulation results.
with Que do
OutTextRealLn('Queue probability',DelayedCount/Count);
end;
begin
// The initial values of the model.
Capacity:=3000;
lambda:=1;
mu:=1.3;
ServersNumber:=2;
QCapacity:=100; // Large enough for
Timeout:=300; // current model values
// Starting of the model.
Simulate(TMyModel);
end.