-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathplotFig.m
More file actions
59 lines (50 loc) · 3.18 KB
/
plotFig.m
File metadata and controls
59 lines (50 loc) · 3.18 KB
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
56
57
58
%% plot curves
% Nuser=1000000,
% arrival_rate=0.05,
% user_prob=[0.5, 0.5],
% mu = [0.8, 0.2]
modes = ['FCFS', 'FCLS','FCFSPriority','FCLSPriority'];
lambda = [0.05, 0.1, 0.2, 0.3, 0.35, 0.4, 0.45 ];
Mean(1,:,:) = [19.98823043070332, 0.01962799999999902, 23.46881805331119, 0.0;
20.038658809399926, 0.019449999999999083, 23.730113954726754, 0.015376;
20.04087652958193, 0.0188519999999994, 23.563767346532902, 0.00458;
20.07304143780299, 0.018711999999999455, 23.699917968577697, 0.011909]; % lambda = 0.05
Mean(2,:,:) = [ 10.177116346073637, 0.09693000000004007, 14.068711785568718, 0.0;
10.150471331469374, 0.09504000000003851, 14.251626579289853, 0.056837;
10.150622278600576, 0.08738400000003269, 14.032428916252275, 0.021247;
10.144673163950747, 0.08715200000003331, 14.15365802988989, 0.045439];% lambda = 0.1
Mean(3,:,:) = [ 6.791503991311653, 0.6972539999988467, 11.633129702326832, 0.0;
5.6813178465240215, 0.7024959999987558, 10.27153604913039, 0.197616;
6.111282301483207, 0.5569139999998541, 10.26889262893724, 0.116247;
5.72599519631246, 0.5610859999998089, 10.085418411597082, 0.169125;];
Mean(4,:,:) =[ 31.958001473855887, 9.450198000000817, 37.957371153893924, 0.0;
5.152766066919833, 9.826124000002077, 9.978603722311798, 0.393627;
7.663705111839767, 6.164903999991954, 10.156163164638677, 0.396022;
5.354528408401126, 5.8394499999910705, 9.618351523204545, 0.353091];
Mean(5,:,:) = [ 182937.4995755263, 63931.99633800135, 199572.83183803008, 0.0;
4.981958873493407, 64166.17992000253, 9.866300506431694, 0.459871;
8.218392579144568, 40446.5902980034, 9.626848755189192, 0.500018;
5.242351086713627, 40860.18294600037, 9.400019867023849, 0.416895];
Mean(6,:,:) =[ 376507.5193087219, 150525.07026600503, 470068.7107429662, 0.0;
4.629182821268881, 148583.848242002, 9.453556363470591, 0.496259;
7.516753146685372, 93922.44193800242, 8.958123553816268, 0.499867;
4.855212413042034, 93818.756967989, 8.878010717586225, 0.450619];
Mean(7,:,:) = [ 2406215.1627191654, 1082825.9068472856, 3384570.026379752, 0.0;
4.348521637061815, 1082163.37360871, 9.134406880657686, 0.528844;
6.9813677533699705, 677846.0101719954, 8.442983449697453, 0.499999;
4.544003108698139, 678143.7523123855, 8.446487641954723, 0.4798832];
figure (1)
plot(lambda, Mean(:,1,1),lambda,Mean(:,2,1),lambda,Mean(:,3,1),lambda,Mean(:,4,1));
legend('FCFS', 'FCLS','FCFSPriority','FCLSPriority');xlabel('Packet Arrival Rate \lambda'); ylabel('Average AoI');
ylim([0, 25]);
figure (2)
plot(lambda, Mean(:,1,3),lambda,Mean(:,2,3),lambda,Mean(:,3,3),lambda,Mean(:,4,3));
legend('FCFS', 'FCLS','FCFSPriority','FCLSPriority');xlabel('Packet Arrival Rate \lambda'); ylabel('Average Peak AoI');
ylim([0, 25]);
figure (3)
semilogy(lambda, Mean(:,1,2),lambda,Mean(:,2,2),lambda,Mean(:,3,2),lambda,Mean(:,4,2));
legend({'FCFS', 'FCLS','FCFSPriority','FCLSPriority'},'location','northwest');
xlabel('Packet Arrival Rate \lambda'); ylabel('Average Queue Len');
figure (4)
semilogy(lambda, Mean(:,1,4),lambda,Mean(:,2,4),lambda,Mean(:,3,4),lambda,Mean(:,4,4));
legend({'FCFS', 'FCLS','FCFSPriority','FCLSPriority'},'location','southeast');xlabel('Packet Arrival Rate \lambda'); ylabel('Ratio of Ineffective Departure');