-
Notifications
You must be signed in to change notification settings - Fork 0
/
impact.R
101 lines (89 loc) · 3.41 KB
/
impact.R
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
source('common.R')
filename <- 'results/11_14/6_selected_seq_landmarks_h+.xlsx'
blind_all <- read_all_results_heuristics(filename, 'T3_BLIND')
lmcut_all <- read_all_results_heuristics(filename, 'T3_LMCUT')
hstar_all <- read_all_results_heuristics(filename, 'T3_HSTAR')
#sat_all <- read_all_results_heuristics(filename, 'SAT')
solved_by_blind <- blind_all %>% filter(solved == 1)
solved_by_lmcut <- lmcut_all %>% filter(solved == 1)
solved_by_hstar <- hstar_all %>% filter(solved == 1)
#solved_by_sat <- sat_all %>% filter(solved == 1)
instances_solved_by_all <- solved_by_blind$instance %>%
intersect(solved_by_lmcut$instance) %>%
intersect(solved_by_hstar$instance)
#%>% intersect(solved_by_sat$instance)
solved_by_blind <- solved_by_blind %>%
filter(instance %in% instances_solved_by_all)
solved_by_lmcut <- solved_by_lmcut %>%
filter(instance %in% instances_solved_by_all)
solved_by_hstar <- solved_by_hstar %>%
filter(instance %in% instances_solved_by_all)
#solved_by_sat <- solved_by_sat %>%
# filter(instance %in% instances_solved_by_all)
solved_by_blind <- solved_by_blind %>%
summarise(
heuristic = 'blind',
seqs = sum(seqs),
seq_time = sum(total_seq_time),
solve_time = sum(total_solve_time),
memory = mean(planner_memory),
cut_size = mean(mean_ops_by_constraint)
)
solved_by_lmcut <- solved_by_lmcut %>%
summarise(
heuristic = 'lmcut',
seqs = sum(seqs),
seq_time = sum(total_seq_time),
solve_time = sum(total_solve_time),
memory = mean(planner_memory),
cut_size = mean(mean_ops_by_constraint)
)
solved_by_hstar <- solved_by_hstar %>%
summarise(
heuristic = 'hstar',
seqs = sum(seqs),
seq_time = sum(total_seq_time),
solve_time = sum(total_solve_time),
memory = mean(planner_memory),
cut_size = mean(mean_ops_by_constraint)
)
#solved_by_sat <- solved_by_sat %>%
# summarise(
# heuristic = 'sat',
# seqs = sum(seqs),
# seq_time = sum(total_seq_time),
# solve_time = sum(total_solve_time),
# memory = mean(planner_memory),
# cut_size = mean(mean_ops_by_constraint)
# )
blind_summary <- read_results(filename, 'Geral', 0, 7)
lmcut_summary <- read_results(filename, 'Geral', 8, 7)
hstar_summary <- read_results(filename, 'Geral', 16, 7)
#sat_summary <- read_results(filename, 'Geral', 24, 7)
coverages <- tribble(~heuristic, ~coverage,
'blind', blind_summary[[6, 'solved']],
'lmcut', lmcut_summary[[6, 'solved']],
'hstar', hstar_summary[[6, 'solved']])
#coverages <- tribble(~heuristic, ~coverage,
# 'blind', blind_summary[[6, 'solved']],
# 'lmcut', lmcut_summary[[6, 'solved']],
# 'hstar', hstar_summary[[6, 'solved']],
# 'sat', sat_summary[[6, 'solved']])
new_names <- c("$C$" = "coverage",
"$S$" = "seqs",
"$\\bar{S_t}$" = "seq_time",
"$\\bar{T_t}$" = "solve_time",
"$\\bar{S_t}$" = "seq_time",
"$\\bar{M}$" = "memory",
"$\\bar{u}$" = "cut_size")
#summaries <- bind_rows(solved_by_blind, solved_by_lmcut, solved_by_hstar, solved_by_sat) %>%
summaries <- bind_rows(solved_by_blind, solved_by_lmcut, solved_by_hstar) %>%
bind_cols(coverages) %>%
select(-heuristic1) %>%
rename(!!!new_names)
save_table(
summaries,
'Comparison using different heuristic functions',
'summary_heuristics',
environment = 'table'
)