-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathplotResults.m
143 lines (133 loc) · 5.14 KB
/
plotResults.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
% #plotResults2.m for lower BL density
% Take simData.csv and theoryData.csv and plot the results
% allData = [pB,pBgiven,freq,freqCond,durCond];
% It is (5x10)*5 = (5x50); Note the 5 terms above for order.
% Create 5 plots for those 5 things
% densityBL = [0.01,0.1,0.2,0.5,0.65];
% densityAP = (1:1:10)/10^4;
clear;
close all;
theory_pB=importdata('figures2/theory_pB.csv',',',1);
theory_pBCond=importdata('figures2/theory_pBCond2.csv',',',1);
theory_freq=importdata('figures2/theory_freq.csv',',',1);
theory_freqCond=importdata('figures2/theory_freqCond2.csv',',',1);
theory_durCond=importdata('figures2/theory_durCond2.csv',',',1);
sim_pB=importdata('figures2/sim_pB.csv',',',1);
sim_pBCond=importdata('figures2/sim_pBCond2.csv',',',1);
sim_freq=importdata('figures2/sim_freq.csv',',',1);
sim_freqCond=importdata('figures2/sim_freqCond2.csv',',',1);
sim_durCond=importdata('figures2/sim_durCond2.csv',',',1);
nlines = size(theory_pB.data,2)-1;
color = {'r','g','b','m','k','c','y','y','y'};
% legendArray = {'\lambda_B=0.1, \omega=0','\lambda_B=0.2, \omega=0',...
% '\lambda_B=0.1, \omega=2\pi/3','\lambda_B=0.2, \omega=2\pi/3'};
% legendArray= {'lamB0.01omega0','lamB0.1omega0','lamB0.2omega0',...
% 'lamB0.01omega60','lamB0.1omega60','lamB0.2omega60'};
legendArray= {'lamB0.005omega0','lamB0.01omega0',...
'lamB0.005omega60','lamB0.01omega60'};
% h=figure(1);
% grid on;
% for j=1:nlines
% semilogy(theory_pB.data(:,1), sim_pB.data(:,j+1),'color',color{j},'LineStyle','--','marker','o','LineWidth',2)
% hold on;
% end
% for j=1:nlines
% semilogy(theory_pB.data(:,1), theory_pB.data(:,j+1),'color',color{j},'LineStyle','-','marker','*','LineWidth',2)
% hold on;
% end
%
% ylim([10^-8,1])
% g=legend(legendArray);
% set(g,'fontsize',13)
% xlabel('AP Density \lambda_T (x 100/km^2)', 'fontsize',13)
% ylabel('Prob all APs blocked within 100m','fontsize',13)
% set(h,'Units','Inches');
% pos = get(h,'Position');
% set(h,'PaperPositionMode','Auto','PaperUnits','Inches','PaperSize',[pos(3), pos(4)])
% print(h,[pwd '/figures2/pB.pdf'],'-dpdf','-r0')
% print(h,[pwd '/figures2/pB.png'],'-dpng','-r0')
h=figure(2);
grid on;
Ax=axes; Ax.YScale='log';
ylim([10^-6 1])
for j=1:nlines
semilogy(theory_pB.data(:,1), sim_pBCond.data(:,j+1),...
'color',color{j},'LineStyle','--','marker','o','LineWidth',2)
% errorbar(theory_pB.data(:,1), sim_pBCond.data(:,j+1),sim_pBCond.data(:,j+7),...
% 'color',color{j},'LineStyle','--','marker','o','LineWidth',2)
hold on;
end
for j=1:nlines
semilogy(theory_pB.data(:,1), theory_pBCond.data(:,j+1),'color',color{j},'LineStyle','-','marker','*','LineWidth',2)
hold on;
end
ylim([10^-8,1])
g=legend(legendArray);
set(g,'fontsize',13)
xlabel('AP Density \lambda_T (x 100/km^2)', 'fontsize',13)
ylabel('P(B|n~=0)','fontsize',13)
set(h,'Units','Inches');
pos = get(h,'Position');
set(h,'PaperPositionMode','Auto','PaperUnits','Inches','PaperSize',[pos(3), pos(4)])
print(h,[pwd '/figures2/pBCond.pdf'],'-dpdf','-r0')
print(h,[pwd '/figures2/pBCond.png'],'-dpng','-r0')
% h=figure(3);
% grid on;
% for j=1:nlines
% semilogy(theory_pB.data(:,1), sim_freq.data(:,j+1),'color',color{j},'LineStyle','--','marker','o','LineWidth',2)
% hold on;
% end
% for j=1:nlines
% semilogy(theory_pB.data(:,1), theory_freq.data(:,j+1),'color',color{j},'LineStyle','-','marker','*','LineWidth',2)
% hold on;
% end
% % ylim([10^-7,1])
% g=legend(legendArray);
% set(g,'fontsize',13)
% xlabel('AP Density \lambda_T (x 100/km^2)', 'fontsize',13)
% ylabel('Expected blockage frequency','fontsize',13)
% set(h,'Units','Inches');
% pos = get(h,'Position');
% set(h,'PaperPositionMode','Auto','PaperUnits','Inches','PaperSize',[pos(3), pos(4)])
% print(h,[pwd '/figures2/freq.pdf'],'-dpdf','-r0')
% print(h,[pwd '/figures2/freq'],'-dpng','-r0')
h=figure(4);
grid on;
for j=1:nlines
semilogy(theory_pB.data(:,1), sim_freqCond.data(:,j+1),'color',color{j},'LineStyle','--','marker','o','LineWidth',2)
hold on;
end
for j=1:nlines
semilogy(theory_pB.data(:,1), theory_freqCond.data(:,j+1),'color',color{j},'LineStyle','-','marker','*','LineWidth',2)
hold on;
end
% ylim([10^-7,1])
g=legend(legendArray);
set(g,'fontsize',13)
xlabel('AP Density \lambda_T (x 100/km^2)', 'fontsize',13)
ylabel('Expected blockage frequency conditioned on n~=0','fontsize',13)
set(h,'Units','Inches');
pos = get(h,'Position');
set(h,'PaperPositionMode','Auto','PaperUnits','Inches','PaperSize',[pos(3), pos(4)])
print(h,[pwd '/figures2/freq.pdf'],'-dpdf','-r0')
print(h,[pwd '/figures2/freq'],'-dpng','-r0')
h=figure(5);
grid on;
for j=1:nlines
semilogy(theory_pB.data(:,1), sim_durCond.data(:,j+1),'color',color{j},'LineStyle','--','marker','o','LineWidth',2)
hold on;
end
for j=1:nlines
semilogy(theory_pB.data(:,1), theory_durCond.data(:,j+1),'color',color{j},'LineStyle','-','marker','*','LineWidth',2)
hold on;
end
ylim([10^-2,1])
g=legend(legendArray);
set(g,'fontsize',13)
xlabel('AP Density \lambda_T (x 100/km^2)', 'fontsize',13)
ylabel('Average blockage duration conditioned on n~=0','fontsize',13)
set(h,'Units','Inches');
pos = get(h,'Position');
set(h,'PaperPositionMode','Auto','PaperUnits','Inches','PaperSize',[pos(3), pos(4)])
print(h,[pwd '/figures2/durCond.pdf'],'-dpdf','-r0')
print(h,[pwd '/figures2/durCond.png'],'-dpng','-r0')