-
Notifications
You must be signed in to change notification settings - Fork 1
/
LTE_show_aggregate_results.m
341 lines (321 loc) · 15.5 KB
/
LTE_show_aggregate_results.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
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
% function [UE_throughput] = LTE_show_aggregate_results(simulation_data)
%
%
%
% if ~isempty(cells_to_plot)
% [UEs_to_use cell_sum_throughput] = utils.resultsFileReader.get_UEs_in_given_cells(cells_to_plot,the_UE_traces);
%
% the_UE_traces_to_plot = the_UE_traces(UEs_to_use);
% wideband_SINRs_all = reshape([the_UE_traces.wideband_SINR],simulation_data.LTE_config.simulation_time_tti,[]);
% wideband_SINRs_all = wideband_SINRs_all(1,:);
%
% % To get the average RB occupancy
% nRB = unique([the_eNodeB_traces(cells_to_plot).RB_grid_size]); % It should be a unique value!
% RB_occupancy_ratio = double([the_eNodeB_traces(cells_to_plot).scheduled_RBs])/nRB;
% mean_RB_occupancy_ratio = mean(RB_occupancy_ratio);
%
% % To get the axes limits
% throughput_Mbps_ecdf_all = utils.miscUtils.ecdf([the_UE_traces.average_throughput_Mbps]);
% spectral_eff_ecdf_all = utils.miscUtils.ecdf([the_UE_traces.average_spectral_efficiency_bit_per_cu]);
% wideband_SINR_ecdf_all = utils.miscUtils.ecdf(wideband_SINRs_all);
%
% % The actual values
% throughput_Mbps_ecdf = utils.miscUtils.ecdf([the_UE_traces_to_plot.average_throughput_Mbps]);
% fairness_index = sum(throughput_Mbps_ecdf.input_data).^2 / sum(throughput_Mbps_ecdf.input_data.^2) / sum(isfinite(throughput_Mbps_ecdf.input_data));
% spectral_eff_ecdf = utils.miscUtils.ecdf([the_UE_traces_to_plot.average_spectral_efficiency_bit_per_cu]);
% wideband_SINR_ecdf = utils.miscUtils.ecdf(wideband_SINRs_all(UEs_to_use));
% UE_throughput = throughput_Mbps_ecdf.x;
%
%
%
% % Wideband SINR-to-throughput plot
% wideband_SINR_vector = wideband_SINR_ecdf.input_data;
% spectral_eff_vector = spectral_eff_ecdf.input_data;
% throughput_vector = throughput_Mbps_ecdf.input_data;
% [wideband_SINR_binned throughput_binned numel_bins] = utils.miscUtils.fit_scatterplot_data(wideband_SINR_vector,throughput_vector,50);
% [wideband_SINR_binned2 spectral_eff_binned numel_bins] = utils.miscUtils.fit_scatterplot_data(wideband_SINR_vector,spectral_eff_vector,50);
%
% % Throughput ECDF
% hold(UE_throughput_axes,'all');
% plot(UE_throughput_axes,throughput_Mbps_ecdf.x,throughput_Mbps_ecdf.f,'blue');
% grid(UE_throughput_axes,'on');
% title(UE_throughput_axes,'UE average throughput');
% xlabel(UE_throughput_axes,'average UE throughput [Mb/s]');
% ylabel(UE_throughput_axes,'F(x)');
% if constant_axes_limits
% xlim(UE_throughput_axes,[throughput_Mbps_ecdf_all.min throughput_Mbps_ecdf_all.max]);
% else
% xlim(UE_throughput_axes,'auto');
% end
% hold(UE_throughput_axes,'off');
%
% % Spectral efficiency ECDF
% hold(UE_spectral_eff_axes,'all');
% plot(UE_spectral_eff_axes,spectral_eff_ecdf.x,spectral_eff_ecdf.f,'blue');
% grid(UE_spectral_eff_axes,'on');
% title(UE_spectral_eff_axes,'UE average spectral efficiency');
% xlabel(UE_spectral_eff_axes,'average UE spectral efficiency [bit/cu]');
% ylabel(UE_spectral_eff_axes,'F(x)');
% if constant_axes_limits
% xlim(UE_spectral_eff_axes,[spectral_eff_ecdf_all.min spectral_eff_ecdf_all.max]);
% else
% xlim(UE_spectral_eff_axes,'auto');
% end
% hold(UE_spectral_eff_axes,'off');
%
% % Wideband SINR ECDF
% hold(UE_wideband_SINR_axes,'all');
% plot(UE_wideband_SINR_axes,wideband_SINR_ecdf.x,wideband_SINR_ecdf.f,'blue');
% grid(UE_wideband_SINR_axes,'on');
% title(UE_wideband_SINR_axes,'UE wideband SINR');
% xlabel(UE_wideband_SINR_axes,'UE wideband SINR [dB]');
% ylabel(UE_wideband_SINR_axes,'F(x)');
% if constant_axes_limits
% xlim(UE_wideband_SINR_axes,[wideband_SINR_ecdf_all.min wideband_SINR_ecdf_all.max]);
% else
% xlim(UE_wideband_SINR_axes,'auto');
% end
% hold(UE_wideband_SINR_axes,'off');
%
% % SINR-to-throughput
% hold(UE_SINR_to_throughput_axes,'all');
% if plot_points_scatter
% if plot_in_GUI
% scatter(UE_SINR_to_throughput_axes,wideband_SINR_vector,throughput_vector,'.b');
% else
% if plot_mean_scatter
% scatter(UE_SINR_to_throughput_axes,wideband_SINR_vector,throughput_vector,'.b','SizeData',50);
% else
% scatter(UE_SINR_to_throughput_axes,wideband_SINR_vector,throughput_vector,'.b','SizeData',150);
% end
% end
% end
% if plot_mean_scatter
% if plot_in_GUI
% scatter(UE_SINR_to_throughput_axes,wideband_SINR_binned,throughput_binned,'.r');
% else
% scatter(UE_SINR_to_throughput_axes,wideband_SINR_binned,throughput_binned,'.r','SizeData',350);
% end
% end
% grid(UE_SINR_to_throughput_axes,'on');
% title(UE_SINR_to_throughput_axes,'UE wideband SINR-to-throughput mapping');
% xlabel(UE_SINR_to_throughput_axes,'UE wideband SINR [dB]');
% ylabel(UE_SINR_to_throughput_axes,'average UE throughput [Mb/s]');
% if constant_axes_limits
% xlim(UE_SINR_to_throughput_axes,[wideband_SINR_ecdf_all.min wideband_SINR_ecdf_all.max]);
% ylim(UE_SINR_to_throughput_axes,[throughput_Mbps_ecdf_all.min throughput_Mbps_ecdf_all.max]);
% else
% xlim(UE_SINR_to_throughput_axes,'auto');
% ylim(UE_SINR_to_throughput_axes,'auto');
% end
% hold(UE_SINR_to_throughput_axes,'off');
%
% % SINR-to-spectral efficiency
% hold(UE_SINR_to_spectral_eff_axes,'all');
% if plot_points_scatter
% if plot_in_GUI
% scatter(UE_SINR_to_spectral_eff_axes,wideband_SINR_vector,spectral_eff_vector,'.b');
% else
% if plot_mean_scatter
% scatter(UE_SINR_to_spectral_eff_axes,wideband_SINR_vector,spectral_eff_vector,'.b','SizeData',50);
% else
% scatter(UE_SINR_to_spectral_eff_axes,wideband_SINR_vector,spectral_eff_vector,'.b','SizeData',150);
% end
% end
% end
% if plot_mean_scatter
% if plot_in_GUI
% scatter(UE_SINR_to_spectral_eff_axes,wideband_SINR_binned,spectral_eff_binned,'.r');
% else
% scatter(UE_SINR_to_spectral_eff_axes,wideband_SINR_binned,spectral_eff_binned,'.r','SizeData',350);
% end
% end
% grid(UE_SINR_to_spectral_eff_axes,'on');
% title(UE_SINR_to_spectral_eff_axes,'UE wideband SINR-to-spectral efficiency mapping');
% xlabel(UE_SINR_to_spectral_eff_axes,'UE wideband SINR [dB]');
% ylabel(UE_SINR_to_spectral_eff_axes,'average UE specctral efficiency [bit/cu]');
% if constant_axes_limits
% xlim(UE_SINR_to_spectral_eff_axes,[wideband_SINR_ecdf_all.min wideband_SINR_ecdf_all.max]);
% ylim(UE_SINR_to_spectral_eff_axes,[spectral_eff_ecdf.min spectral_eff_ecdf.max]);
% else
% xlim(UE_SINR_to_spectral_eff_axes,'auto');
% ylim(UE_SINR_to_spectral_eff_axes,'auto');
% end
% hold(UE_SINR_to_spectral_eff_axes,'off');
%
% cell_sum_throughput_non_NaN = cell_sum_throughput(isfinite(cell_sum_throughput));
% cell_sum_throughput_non_NaN_mean = mean(cell_sum_throughput_non_NaN);
% ignored_cells = sum(isnan(cell_sum_throughput));
%
% sep = '---------------------------------------';
% statistics_text = sprintf([
% '%s\nSimulations statistics:\n\n',...
% '%g cells, %g UEs\n',...
% 'Simulation length: %g TTIs\n',...
% 'Scheduler: %s\n',...
% 'Mode: %gx%g, %s\n',...
% '%s\n',...
% 'Cell statistics:\n\n',...
% 'Fairness index: %g\n',...
% 'Peak/Avg/Edge UE throughput:\n',...
% '%3.2f/%3.2f/%3.2f Mb/s\n',...
% 'Average cell throughput: %3.2fMb/s\n',...
% 'Ignored cells (disabled): %g\n',...
% 'mean RB occupancy: %3.2f%%\n%s',...
% ],...
% sep,...
% length(cells_to_plot),...
% sum(UEs_to_use),...
% simulation_data.LTE_config.simulation_time_tti,...
% simulation_data.LTE_config.scheduler,...
% simulation_data.LTE_config.nTX,...
% simulation_data.LTE_config.nRX,...
% utils.miscUtils.tx_mode_to_string(simulation_data.LTE_config.tx_mode),...
% sep,...
% fairness_index,...
% throughput_Mbps_ecdf.p95,...
% throughput_Mbps_ecdf.mean_x,...
% throughput_Mbps_ecdf.p05,...
% cell_sum_throughput_non_NaN_mean,...
% ignored_cells,...
% mean_RB_occupancy_ratio*100,sep);
% if plot_in_GUI
% set(handles.cell_statistics_text,'String',statistics_text);
% else
% set(handles.cell_statistics_text,'String',statistics_text);
% fprintf('%s\n',statistics_text);
% end
% end
function [WideBand_SINR,UE_Throughput] = LTE_show_aggregate_results(simulation_data)
%UNTITLED Summary of this function goes here
% Detailed explanation goes here
UE_list = cell(1,length(simulation_data.UEs));
for u_=1:length(simulation_data.UEs)
UE_list{u_} = sprintf('%g',u_);
end
cell_list = cell(1,length(simulation_data.eNodeBs));
for c_=1:length(simulation_data.eNodeBs)
cell_list{c_} = sprintf('%g',c_);
end
simulation_data.UE_list = UE_list;
simulation_data.cell_list = cell_list;
if isfield(simulation_data.LTE_config,'default_shown_GUI_cells') && ~isempty(simulation_data.LTE_config.default_shown_GUI_cells)
cells_to_plot = simulation_data.LTE_config.default_shown_GUI_cells;
if simulation_data.LTE_config.compact_results_file
cells_to_plot = cells_to_plot(cells_to_plot<=length(simulation_data.the_eNodeB_traces)); % Filtero out possible out of range values
else
cells_to_plot = cells_to_plot(cells_to_plot<=length(simulation_data.simulation_traces.eNodeB_tx_traces)); % Filtero out possible out of range values
end
end
% Plot main plot
% Load data
eNodeB_sites = simulation_data.eNodeB_sites;
eNodeBs = simulation_data.eNodeBs;
UEs = simulation_data.UEs;
networkPathlossMap = simulation_data.networkPathlossMap;
if isfield(simulation_data,'simulation_traces')
% non-compact results
the_UE_traces = [simulation_data.simulation_traces.UE_traces];
the_eNodeB_traces = [simulation_data.simulation_traces.eNodeB_tx_traces];
else
the_UE_traces = simulation_data.the_UE_traces;
the_eNodeB_traces = simulation_data.the_eNodeB_traces;
end
cells_to_plot = cells_to_plot(cells_to_plot<=length(the_eNodeB_traces)); % Filtero out possible out of range values
N_UEs = length(UEs);
% UE_throughput_axes = handles.UE_throughput_axes;
% UE_spectral_eff_axes = handles.UE_spectral_eff_axes;
% UE_wideband_SINR_axes = handles.UE_wideband_SINR_axes;
% UE_SINR_to_throughput_axes = handles.UE_SINR_to_throughput_axes;
% UE_SINR_to_spectral_eff_axes = handles.UE_SINR_to_spectral_eff_axes;
% Clear old plots
% cla(UE_throughput_axes);
% cla(UE_spectral_eff_axes);
% cla(UE_wideband_SINR_axes);
% cla(UE_SINR_to_throughput_axes);
% cla(UE_SINR_to_spectral_eff_axes);
if ~isempty(cells_to_plot)
[UEs_to_use cell_sum_throughput] = utils.resultsFileReader.get_UEs_in_given_cells(cells_to_plot,the_UE_traces);
the_UE_traces_to_plot = the_UE_traces(UEs_to_use);
wideband_SINRs_all = reshape([the_UE_traces.wideband_SINR],simulation_data.LTE_config.simulation_time_tti,[]);
wideband_SINRs_all = wideband_SINRs_all(1,:);
% To get the average RB occupancy
nRB = unique([the_eNodeB_traces(cells_to_plot).RB_grid_size]); % It should be a unique value!
RB_occupancy_ratio = double([the_eNodeB_traces(cells_to_plot).scheduled_RBs])/nRB;
mean_RB_occupancy_ratio = mean(RB_occupancy_ratio);
% To get the axes limits
throughput_Mbps_ecdf_all = utils.miscUtils.ecdf([the_UE_traces.average_throughput_Mbps]);
spectral_eff_ecdf_all = utils.miscUtils.ecdf([the_UE_traces.average_spectral_efficiency_bit_per_cu]);
wideband_SINR_ecdf_all = utils.miscUtils.ecdf(wideband_SINRs_all);
% The actual values
throughput_Mbps_ecdf = utils.miscUtils.ecdf([the_UE_traces_to_plot.average_throughput_Mbps]);
fairness_index = sum(throughput_Mbps_ecdf.input_data).^2 / sum(throughput_Mbps_ecdf.input_data.^2) / sum(isfinite(throughput_Mbps_ecdf.input_data));
spectral_eff_ecdf = utils.miscUtils.ecdf([the_UE_traces_to_plot.average_spectral_efficiency_bit_per_cu]);
wideband_SINR_ecdf = utils.miscUtils.ecdf(wideband_SINRs_all(UEs_to_use));
WideBand_SINR=wideband_SINRs_all(UEs_to_use);
UE_Throughput=[the_UE_traces_to_plot.average_throughput_Mbps];
UE_Efficiency=[the_UE_traces_to_plot.average_spectral_efficiency_bit_per_cu];
% Wideband SINR Text file
% fid = fopen('Rx SINR.txt','wt');
% fprintf(fid,'%0.6f %0.6f\n',wideband_SINR_ecdf.x);
% fclose(fid);
% % Wideband SINR-to-throughput plot
% wideband_SINR_vector = wideband_SINR_ecdf.input_data;
% spectral_eff_vector = spectral_eff_ecdf.input_data;
% throughput_vector = throughput_Mbps_ecdf.input_data;
% [wideband_SINR_binned throughput_binned numel_bins] = utils.miscUtils.fit_scatterplot_data(wideband_SINR_vector,throughput_vector,50);
% [wideband_SINR_binned2 spectral_eff_binned numel_bins] = utils.miscUtils.fit_scatterplot_data(wideband_SINR_vector,spectral_eff_vector,50);
%
%
% hold(UE_SINR_to_throughput_axes,'all');
% %plot(UE_SINR_to_throughput_axes,wideband_SINR_ecdf.x,throughput_Mbps_ecdf.x(1:length(wideband_SINR_ecdf.x),:),'k');
% plot(UE_SINR_to_throughput_axes,wideband_SINR_ecdf.x(1:length(throughput_Mbps_ecdf.x),:),throughput_Mbps_ecdf.x,'k'); % For Macro Only case
% grid(UE_SINR_to_throughput_axes,'on');
% title(UE_SINR_to_throughput_axes,'UE Rx SINR-to-throughput mapping');
% xlabel(UE_SINR_to_throughput_axes,'UE Rx SINR [dB]');
% ylabel(UE_SINR_to_throughput_axes,'UE Average throughput [Mb/s]');
% %plot(wideband_SINR_ecdf.x,throughput_Mbps_ecdf.x(1:length(wideband_SINR_ecdf.x),:),'k'); % To plot the
%
%
% % Throughput ECDF
% hold(UE_throughput_axes,'all');
% plot(UE_throughput_axes,throughput_Mbps_ecdf.x,throughput_Mbps_ecdf.f,'blue');
% grid(UE_throughput_axes,'on');
% title(UE_throughput_axes,'UE Average Throughput');
% xlabel(UE_throughput_axes,' UE Average Throughput [Mb/s]');
% ylabel(UE_throughput_axes,'CDF');
%
% xlim(UE_throughput_axes,'auto');
%
% hold(UE_throughput_axes,'off');
%
% % Spectral efficiency ECDF
% hold(UE_spectral_eff_axes,'all');
% plot(UE_spectral_eff_axes,spectral_eff_ecdf.x,spectral_eff_ecdf.f,'blue');
% grid(UE_spectral_eff_axes,'on');
% title(UE_spectral_eff_axes,'UE average spectral efficiency');
% xlabel(UE_spectral_eff_axes,'UE average spectral efficiency [bit/cu]');
% ylabel(UE_spectral_eff_axes,'CDF');
%
%
% xlim(UE_spectral_eff_axes,'auto');
%
% hold(UE_spectral_eff_axes,'off');
%
% % Wideband SINR ECDF
% hold(UE_wideband_SINR_axes,'all');
% plot(UE_wideband_SINR_axes,wideband_SINR_ecdf.x,wideband_SINR_ecdf.f,'blue');
% grid(UE_wideband_SINR_axes,'on');
% title(UE_wideband_SINR_axes,'UE Rx SINR');
% xlabel(UE_wideband_SINR_axes,'UE Rx SINR [dB]');
% ylabel(UE_wideband_SINR_axes,'CDF');
%
% xlim(UE_wideband_SINR_axes,[wideband_SINR_ecdf_all.min wideband_SINR_ecdf_all.max]);
%
%
% hold(UE_wideband_SINR_axes,'off');
%
% % SINR-to-throughput
% hold(UE_SINR_to_throughput_axes_s,'all');
%
end