-
Notifications
You must be signed in to change notification settings - Fork 0
/
boxplot_time.m
65 lines (54 loc) · 2.09 KB
/
boxplot_time.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
clearvars; close all; clc;
T_t = [];
T_t_f = [];
figure(1)
for j=1:1:6
clearvars -except j T_t T_t_f; %close all; clc;
tests = [0 0 0 1 1 1; 0 1 2 0 1 2];
total_time = [];
total_time_first_sol = [];
succ_node = tests(1,j);
informed = tests(2,j);
folder_name1 = ['test_' num2str(succ_node) num2str(informed)];
folder_path = ['/home/cesare/TESI/test_tempo_esecuzione/' folder_name1];
for i=1:1:10
folder_name2 = ['/test_' num2str(i) '_succNode_informed_' num2str(succ_node) num2str(informed)];
folder_path2 = [folder_path folder_name2 '/test_number_20.mat'];
load([folder_path folder_name2 '/test_number_20.mat'],'time_vector');
load([folder_path folder_name2 '/test_number_20.mat'],'time_first_sol_vector');
total_time = [total_time,time_vector]; %#ok<*AGROW>
total_time_first_sol = [total_time_first_sol,time_first_sol_vector];%#ok<*AGROW>
end
T_t = [T_t,total_time'];
T_t_f = [T_t_f,total_time_first_sol'];
end
%color = ["r";"k";"g";"y";"c";"b"];
color = [[1 0 0];[0 0 0];[0 1 0];[1 1 0];[0 1 1];[0 0 1]];
n1 = 1;
figure(n1)
hold on
[p1] = boxplot(T_t,'Colors',color,'BoxStyle','filled');
n2 = 2;
figure(n2)
hold on
[p1_first_sol] = boxplot(T_t_f,'Colors',color,'BoxStyle','filled');
figure(n1)
title('Algorithms comparison: computational time','FontSize',18)
lgd=legend ({'00','01','02','10','11','12'},'FontSize',18);
title(lgd,'Algorithm version','FontSize',18)
xlabel('Algorithm version','FontSize',18);
ylabel('Computational Time[s]','FontSize',18);
%axis([0 8 -1 28])
grid on
xticks([1 2 3 4 5 6])
%savefig(['/home/cesare/TESI/test_tempo_esecuzione/' 'Execution_Time'])
figure(n2)
title('Algorithms comparison: computational time to find a first solution','FontSize',18)
lgd=legend ({'00','01','02','10','11','12'},'FontSize',18);
title(lgd,'Algorithm version','FontSize',18)
xlabel('Algorithm version','FontSize',18);
ylabel('Computational Time[s]','FontSize',18);
%axis([0 8 -0.1 1.2])
grid on
xticks([1 2 3 4 5 6])
%savefig(['/home/cesare/TESI/test_tempo_esecuzione/' 'Execution_Time_first_sol'])