-
Notifications
You must be signed in to change notification settings - Fork 26
/
OutputPlots.m
146 lines (141 loc) · 2.75 KB
/
OutputPlots.m
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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
% Plotting energy consumption versus number of mobile users
numusers = categorical([12,20,32,40,60]);
SAPA = [25.101
27.537
80.1366
946.424
1813.65];
PSO = [4.7213
7.4689
12.6144
19.8159
26.0105];
bar(numusers,[PSO,SAPA]);
grid on;
ylim([0 100]);
legend('PSO','SAPA')
xlabel('Number of mobile users')
ylabel('Energy Consumption (J)')
%%
% Plotting energy consumption versus pmax
numusers = categorical([12,20,32,40,60]);
pmax_4 = [4.7213
7.4689
10.0413
17.766
23.8686];
pmax_5 = [4.7213
7.4689
12.6144
19.8159
26.0105];
pmax_6 = [4.7213
7.5415
12.7801
18.9349
28.7437];
plot(numusers,pmax_4,'-d',...
'LineWidth',2,...
'MarkerFaceColor','blue',...
'MarkerSize',5);
hold on;
plot(numusers,pmax_5,'-^',...
'LineWidth',2,...
'MarkerFaceColor','r',...
'MarkerSize',5);
plot(numusers,pmax_6,'-o',...
'LineWidth',2,...
'MarkerFaceColor','green',...
'MarkerSize',5);
hold off;
grid on;
ylim([0 40]);
legend('Pmax = 4W','Pmax = 5W','Pmax = 6W')
xlabel('Number of mobile users')
ylabel('Energy Consumption (J)')
%%
% Plotting performance versus number of mobile users
numusers = categorical([12,20,32,40,60]);
rr = [1
1
1
0.95
0.9];
bar(numusers,rr,0.4);
ylim([0 1.2]);
grid on;
xlabel('Number of mobile users')
ylabel('Response rate')
welfare = [11.9989
19.9952
31.9894
36.0156
50.0382];
plot(numusers,welfare,'-d',...
'LineWidth',2,...
'MarkerFaceColor','blue',...
'MarkerSize',5);
grid on;
xlabel('Number of mobile users')
ylabel('Welfare')
%%
% Plotting welfare under different request workload
numusers = categorical([12,20,32,40,60]);
w1500 = [11.9989
19.9952
31.9894
36.0156
50.0382];
w2000 = [11.9990
19.9975
31.9915
38.0651
50.0486];
w2500 = [11.9963
19.9919
31.9874
39.0129
51.019];
plot(numusers,w1500,'-d',...
'LineWidth',2,...
'MarkerFaceColor','blue',...
'MarkerSize',5);
hold on;
plot(numusers,w2000,'-^',...
'LineWidth',2,...
'MarkerFaceColor','r',...
'MarkerSize',5);
plot(numusers,w2500,'-o',...
'LineWidth',2,...
'MarkerFaceColor','green',...
'MarkerSize',5);
hold off;
grid on;
ylim([0 70]);
legend('Wq = 1500','Wq = 2000','Wq = 2500')
xlabel('Number of mobile users')
ylabel('Welfare')
%%
% Plotting welfare versus request workload
rworkload = categorical([1000,1500,2000,2500,3000]);
welf = [52.04569
50.0382
50.041
50.039
50.0279];
bar(rworkload,welf,0.4,'red');
grid on;
xlabel('Request Workload (Magacycles)')
ylabel('Welfare')
%%
% Plotting welfare versus request input
Inputdata = categorical([600,700,800,900,1000]);
welfinput = [50.0434
50.0382
47.1137
47.6045
47.4919];
bar(Inputdata,welfinput,0.4,'magenta');
grid on;
xlabel('Request Input (MB)')
ylabel('Welfare')