From b0e3215616664e4754c7a6c4c19d63e845e85da0 Mon Sep 17 00:00:00 2001 From: hanhxiao Date: Mon, 23 Sep 2019 17:47:13 +0800 Subject: [PATCH] fix: fix route table total time --- gnes/helper.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/gnes/helper.py b/gnes/helper.py index 9c3955d2..d4df0a67 100644 --- a/gnes/helper.py +++ b/gnes/helper.py @@ -586,12 +586,12 @@ def _path_import(absolute_path): return module, spec -def make_route_table(routes, exclude_frontend: bool = False): +def make_route_table(routes, exclude_frontend: bool = False, jitter: float = 1e-8): route_time = [] if exclude_frontend: - total_duration = get_duration(routes[0].start_time, routes[0].end_time) + total_duration = get_duration(routes[0].start_time, routes[0].end_time) + jitter else: - total_duration = get_duration(routes[0].start_time, routes[-1].end_time) + total_duration = get_duration(routes[0].start_time, routes[-1].end_time) + jitter sum_duration = 0 for k in routes[(1 if exclude_frontend else 0):]: d = get_duration(k.start_time, k.end_time)