-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathits_stats.m
78 lines (69 loc) · 2.67 KB
/
its_stats.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
function its_stats()
%ITS_STATS Summary of this function goes here
% Detailed explanation goes here
% flex
reload = false;
if reload
tbl = process_metrics("output", 10);
tbl = tbl(tbl.density < 4000,:);
tbl_out = add_tch_stats(tbl);
save("its_stats","tbl_out");
tbl = tbl_out;
else
tbl = load("its_stats.mat");
tbl = tbl.tbl_out;
end
structs = unique(tbl.struct)';
flexes = unique(tbl.flex)';
speeds = unique(tbl.speed)';
densities = unique(tbl.density)';
tbl_structs = [];
for struct = structs
flex_means = [];
f_tbl = tbl(tbl.struct == struct,:);
for flex = flexes
m = mean(f_tbl{f_tbl.flex == flex, "delay_mean"});
flex_means = [flex_means; flex m];
end
flex_diffs = flex_means(2:end,:)-flex_means(1:end-1,:);
flex_diffs = flex_diffs(:,2)./flex_diffs(:,1);
flex_sense = mean(flex_diffs);
tbl_struct.struct = struct;
tbl_struct.flex_sense = flex_sense;
speed_means = [];
for speed = speeds
m = mean(f_tbl{f_tbl.speed == speed, "delay_mean"});
speed_means = [speed_means; speed m];
end
speed_diffs = speed_means(2:end,:)-speed_means(1:end-1,:);
speed_diffs = speed_diffs(:,2)./speed_diffs(:,1);
speed_sense = mean(speed_diffs);
tbl_struct.speed_sense = speed_sense;
density_means = [];
for density = densities
m = mean(f_tbl{f_tbl.density == density, "delay_mean"});
density_means = [density_means; density m];
end
density_diffs = density_means(2:end,:)-density_means(1:end-1,:);
density_diffs = density_diffs(:,2)./density_diffs(:,1);
density_sense = mean(density_diffs);
tbl_struct.density_sense = density_sense;
tbl_structs = [tbl_structs tbl_struct];
end
t = struct2table(tbl_structs);
t.density_sense = t.density_sense / max(abs(t.density_sense));
t.speed_sense = t.speed_sense / max(abs(t.speed_sense));
t.flex_sense = t.flex_sense / max(abs(t.flex_sense));
t.struct = ["FAA", "Delaunay", "Grid/Delaunay", "GIS", "GRID"]';
x = categorical(t.struct);
x = reordercats(x,["FAA", "Delaunay", "Grid/Delaunay", "GIS", "GRID"]);
y1 = t.density_sense;
y2 = t.speed_sense;
y3 = t.flex_sense;
h = plot(x',y1,'-o',x',y2,'-+',x',y3, '-^', 'LineWidth',1.5);
legend("Density Sensitivity", "Speed Sensitivity", "Flex Sensitivity");
grid
title("Mean-Delay Relative Sensitivity");
ylabel("Proportional Change Relative to Maximum Outcome");
xlabel("Airspace Structure");
end