-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathplot_results.m
More file actions
94 lines (88 loc) · 3.24 KB
/
Copy pathplot_results.m
File metadata and controls
94 lines (88 loc) · 3.24 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
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
% make the plots in this file
resultsExist = exist('results','var');
proceed = 0;
if resultsExist == 1
prompt = 'Do you want to load results different from the existing ones? y/n [n]: ';
str = input(prompt,'s');
if isempty(str) || str == 'n'
str = 'n';
fprintf('I will plot existing result.\n');
proceed = 1;
elseif str == 'y'
prompt = 'This will erase existing the results variable. Are you sure? y/n [n]: ';
str = input(prompt,'s');
if isempty(str) || str == 'n'
str = 'n';
fprintf('I will plot existing result.\n');
proceed = 1;
elseif str == 'y'
clear('results');
[filename, ~,~] = uigetfile('jsac-sim*.mat', 'Select a .mat file');
if ~isempty(filename)
proceed = 1;
load(filename);
end
end
else
fprintf('Please answer "y" or "n". Start again.\n');
end
elseif resultsExist == 0
fprintf('There are no results to plot. Looking for a file to load them.\n');
[filename, ~,~] = uigetfile('jsac-sim*.mat', 'Select a .mat file');
if filename ~= 0
proceed = 1;
load(filename);
end
end
if proceed == 1
set(groot,'defaultAxesColorOrder',[ 0 0.4470 0.7410; 0.8500 0.3250 0.0980 ; 0.9290 0.6940 0.1250 ; 0.4940 0.1840 0.5560 ; 0.4660 0.6740 0.1880 ; 0.3010 0.7450 0.9330 ; 0.6350 0.0780 0.1840],'defaultAxesLineStyleOrder','-|--|:|-.')
% plot throughput against load together with a scatterplot of the mean delay
for figind = unique({results.mode})
figure('Name',strcat(char(figind),' - Load, Throughput and Delay'),'NumberTitle','off');
hold on
title('Load, throughput and delay for different RAF lengths','FontWeight','normal')
legendInfo = cell(numel(find(strcmp(figind,{results.mode}))),1);
legendIndex = 1;
for ploind = find(strcmp(figind,{results.mode}))
plot(results(ploind).load, results(ploind).throughput);
legendInfo{legendIndex} = num2str(results(ploind).rafLength);
legendIndex = legendIndex + 1;
end
xlabel('Load')
ylabel('Throughput')
colormap jet;
clrbr = colorbar;
ylabel(clrbr, 'Mean delay')
legend(legendInfo,'Location','NorthWest')
% scatterplot of the mean delay
for ploind = find(strcmp(figind,{results.mode}))
scatter(results(ploind).load,results(ploind).throughput,40,(results(ploind).meanDelay),'filled');
end
end
% plot delay against throughput together with a scatterplot of the load
for figind = unique({results.mode})
figure('Name',strcat(char(figind),' - Throughput and Delay'),'NumberTitle','off');
hold on
title('Throughput, mean delay and load for different RAF lengths','FontWeight','normal')
legendInfo = cell(numel(find(strcmp(figind,{results.mode}))),1);
legendIndex = 1;
for ploind = find(strcmp(figind,{results.mode}))
plot(results(ploind).throughput,results(ploind).meanDelay);
legendInfo{legendIndex} = num2str(results(ploind).rafLength);
legendIndex = legendIndex + 1;
end
xlabel('Throughput')
ylabel('Mean delay')
clrbr = colorbar;
ylabel(clrbr, 'Load')
legend(legendInfo,'Location','SouthEast')
% scatterplot of the mean load
for ploind = find(strcmp(figind,{results.mode}))
scatter(results(ploind).throughput,results(ploind).meanDelay,40,(results(ploind).load),'filled');
end
end
set(groot,'defaultAxesLineStyleOrder','remove')
set(groot,'defaultAxesColorOrder','remove')
else
fprintf('Exiting.\n')
end