-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathaggregate_results.py
31 lines (28 loc) · 1.28 KB
/
aggregate_results.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
import json
import argparse as arg
import matplotlib.pyplot as plt
import statistics
# parser = arg.ArgumentParser("Aggregate & make plots with data from mobile robot paralelism")
# parser.add_argument('target_path', type=str, help="path to JSON file with parallelism results")
# parser.add_argument('ground_truth_file_path', type=str, help="path to SEQ file with ground truth values")
# parser.add_argument('-g', '--gesture_name', metavar='NAME', type=str, default=None, help="name of gesture to be parsed, optional")
# args = parser.parse_args()
# target_path = args.target_path
target_path = "./results/many"
list_results = []
for i in list_files:
with open(f"{target_path}/{i}") as json_file:
result = json.load(json_file)
list_results.append(result[0])
print(len(list_results))
#TODO zrobic dane gdzie beda powarzalne warunki z jednym rpocesorem i zobaczyc czy wychodza te same wyniki
durations = [float(d["duration"]) for d in list_results]
costs = [float(d["cost_best_path"]) for d in list_results]
mean_cost = statistics.mean(costs)
min_cost = min(costs)
max_cost = max(costs)
mean_duration = statistics.mean(durations)
min_duration = min(durations)
max_duration = max(durations)
print(min_cost, " ", mean_cost, " ", max_cost)
print(min_duration, " ", mean_duration, " ", max_duration)