-
Notifications
You must be signed in to change notification settings - Fork 4
/
MMCqueue.pas
55 lines (42 loc) · 1.73 KB
/
MMCqueue.pas
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
(******************************************************************************
This is an example using OpenSIMPLY.
Download the OpenSIMPLY at https://opensimply.org/
*******************************************************************************)
program MMCqueue;
{$apptype GUI}
{$S-}
uses
SimBase,
SimBlocks,
SimStdGUI;
type
TMyModel = class(TModel) // Model declaration.
procedure Body; override;
end;
var
Capacity, // Model parameters.
NumberOfServers: Integer;
InterarrivalTime,
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.CreateDefault;
Sel := TSelector.Create([NumberOfServers]);
Gen.Connect(Que);
Que.Connect(Sel);
Sel.Connect(1, NumberOfServers, TServer, [ExpTime, ServiceTime]);
Run(Gen); // Launching the start block.
Que.ShowStat; // Results.
end;
begin
Capacity := 3000; // Initial values of the model.
InterarrivalTime := 1;
ServiceTime := 1.3;
NumberOfServers := 2;
Simulate(TMyModel, 'The M/M/C queuing system'); // Starting a model.
end.