This repository has been archived by the owner on Dec 10, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
run.py
50 lines (39 loc) · 1.91 KB
/
run.py
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
from scripts.experiment import *
from scripts.output_results import write_batch_experiment_summary
from datetime import date, datetime
repeat_num = 1
# household_nums = [2000, 4000, 6000, 8000, 10000]
# household_nums = [20, 40, 60, 80, 100]
# household_nums = household_nums.reverse()
household_nums = [10]
new_data = True
# new_data = False
type_cost_function = "piece-wise"
# type_cost_function = "linear"
algorithms_labels = dict()
# algorithms_labels[k1_optimal] = dict()
# algorithms_labels[k1_optimal][k2_scheduling] = k1_optimal
# algorithms_labels[k1_optimal][k2_pricing] = "{}_fw".format(k1_optimal)
algorithms_labels[k1_heuristic] = dict()
algorithms_labels[k1_heuristic][k2_scheduling] = k1_heuristic
algorithms_labels[k1_heuristic][k2_pricing] = "{}_fw".format(k1_heuristic)
this_date = str(date.today())
this_time = str(datetime.now().time().strftime("%H-%M-%S"))
date_folder = result_folder + "{}/".format(this_date)
date_time_folder = date_folder + "{}/".format(this_time)
experiment_summary_dict = dict()
group_by_columns = [k0_households_no, k0_tasks_no, "algorithm", k0_penalty_weight, k0_cost_type]
def run():
for n in household_nums:
for r in range(repeat_num):
date_time_experiment_folder = date_time_folder \
+ "h{0}-t{1}-w{2}-r{3}/".format(n, no_tasks_min, care_f_weight, r)
experiment_summary = experiment(n, no_tasks_min, no_tasks_min + 2, new_data, type_cost_function,
algorithms_labels, date_time_experiment_folder)
for algorithm in algorithms_labels.values():
for v in algorithm.values():
experiment_summary_dict[r, n, v] = experiment_summary[v]
# write batch experiment summary
write_batch_experiment_summary(experiment_summary_dict, group_by_columns, date_time_folder, this_time)
if __name__ == '__main__':
run()