better timing
This commit is contained in:
parent
d1c53e08bb
commit
1ade92aed3
@ -2,5 +2,5 @@ detour_factor: 1.4
|
||||
detour_corridor_width: 300
|
||||
average_walking_speed: 4.8
|
||||
max_landmarks: 10
|
||||
max_landmarks_refiner: 20
|
||||
overshoot: 1.4
|
||||
max_landmarks_refiner: 30
|
||||
overshoot: 1.8
|
||||
|
@ -24,8 +24,8 @@ def test(start_coords: tuple[float, float], finish_coords: tuple[float, float] =
|
||||
nature=Preference(type='nature', score = 5),
|
||||
shopping=Preference(type='shopping', score = 5),
|
||||
|
||||
max_time_minute=180,
|
||||
detour_tolerance_minute=10
|
||||
max_time_minute=100,
|
||||
detour_tolerance_minute=0
|
||||
)
|
||||
|
||||
# Create start and finish
|
||||
@ -63,7 +63,7 @@ def test(start_coords: tuple[float, float], finish_coords: tuple[float, float] =
|
||||
logger.info("Optimized route : ")
|
||||
for l in linked_tour :
|
||||
logger.info(f"{l}")
|
||||
logger.info(f"Estimated length of tour : {linked_tour.total_time}")
|
||||
logger.info(f"Estimated length of tour : {linked_tour.total_time} mintutes and visiting {len(linked_tour._landmarks)} landmarks.")
|
||||
|
||||
# with open('linked_tour.yaml', 'w') as f:
|
||||
# yaml.dump(linked_tour.asdict(), f)
|
||||
@ -74,6 +74,6 @@ def test(start_coords: tuple[float, float], finish_coords: tuple[float, float] =
|
||||
# test(tuple((48.8344400, 2.3220540))) # Café Chez César
|
||||
# test(tuple((48.8375946, 2.2949904))) # Point random
|
||||
# test(tuple((47.377859, 8.540585))) # Zurich HB
|
||||
test(tuple((45.758217, 4.831814))) # Lyon Bellecour
|
||||
# test(tuple((48.5848435, 7.7332974))) # Strasbourg Gare
|
||||
# test(tuple((45.758217, 4.831814))) # Lyon Bellecour
|
||||
test(tuple((48.5848435, 7.7332974))) # Strasbourg Gare
|
||||
# test(tuple((48.2067858, 16.3692340))) # Vienne
|
||||
|
@ -195,7 +195,7 @@ class Optimizer:
|
||||
for j, spot2 in enumerate(landmarks) :
|
||||
t = get_time(spot1.location, spot2.location) + spot1.duration
|
||||
dist_table[j] = t
|
||||
closest = sorted(dist_table)[:20]
|
||||
closest = sorted(dist_table)[:25]
|
||||
for i, dist in enumerate(dist_table) :
|
||||
if dist not in closest :
|
||||
dist_table[i] = 32700
|
||||
|
@ -214,7 +214,7 @@ class Refiner :
|
||||
if self.is_in_area(area, landmark.location) and landmark.name not in visited_names:
|
||||
second_order_landmarks.append(landmark)
|
||||
|
||||
return take_most_important.take_most_important(second_order_landmarks, len(visited_landmarks))
|
||||
return take_most_important.take_most_important(second_order_landmarks, int(self.max_landmarks_refiner*0.75))
|
||||
|
||||
|
||||
# Try fix the shortest path using shapely
|
||||
|
Loading…
x
Reference in New Issue
Block a user