fixed timing and optimizer speed
All checks were successful
Build and push docker image / Build (pull_request) Successful in 1m49s
Build and release APK / Build APK (pull_request) Successful in 5m40s

This commit is contained in:
Helldragon67 2024-09-10 16:50:12 +02:00
parent 20f20da9c5
commit 3475990e5f
5 changed files with 11 additions and 11 deletions

View File

@ -7,5 +7,5 @@ tag_exponent: 1.15
image_bonus: 10 image_bonus: 10
viewpoint_bonus: 15 viewpoint_bonus: 15
wikipedia_bonus: 6 wikipedia_bonus: 6
N_important: 50 N_important: 40
pay_bonus: -1 pay_bonus: -1

View File

@ -1,5 +1,5 @@
detour_factor: 1.4 detour_factor: 1.4
detour_corridor_width: 200 detour_corridor_width: 300
average_walking_speed: 4.8 average_walking_speed: 4.8
max_landmarks: 10 max_landmarks: 10
max_landmarks_refiner: 20 max_landmarks_refiner: 20

View File

@ -24,8 +24,8 @@ def test(start_coords: tuple[float, float], finish_coords: tuple[float, float] =
nature=Preference(type='nature', score = 5), nature=Preference(type='nature', score = 5),
shopping=Preference(type='shopping', score = 5), shopping=Preference(type='shopping', score = 5),
max_time_minute=1000, max_time_minute=120,
detour_tolerance_minute=0 detour_tolerance_minute=10
) )
# Create start and finish # Create start and finish
@ -70,9 +70,9 @@ def test(start_coords: tuple[float, float], finish_coords: tuple[float, float] =
return linked_tour return linked_tour
test(tuple((48.8344400, 2.3220540))) # Café Chez César # test(tuple((48.8344400, 2.3220540))) # Café Chez César
# test(tuple((48.8375946, 2.2949904))) # Point random # test(tuple((48.8375946, 2.2949904))) # Point random
# test(tuple((47.377859, 8.540585))) # Zurich HB test(tuple((47.377859, 8.540585))) # Zurich HB
# test(tuple((45.7576485, 4.8330241))) # Lyon Bellecour # test(tuple((45.758217, 4.831814))) # Lyon Bellecour
# test(tuple((48.5848435, 7.7332974))) # Strasbourg Gare # test(tuple((48.5848435, 7.7332974))) # Strasbourg Gare
# test(tuple((48.2067858, 16.3692340))) # Vienne # test(tuple((48.2067858, 16.3692340))) # Vienne

View File

@ -318,6 +318,7 @@ class LandmarkManager:
if "viewpoint" in tag: if "viewpoint" in tag:
score += self.viewpoint_bonus score += self.viewpoint_bonus
duration = 10
if "image" in tag: if "image" in tag:
score += self.image_bonus score += self.image_bonus
@ -334,7 +335,6 @@ class LandmarkManager:
if tag == "building" and elem.tag('building') in ['retail', 'supermarket', 'parking']: if tag == "building" and elem.tag('building') in ['retail', 'supermarket', 'parking']:
skip = True skip = True
break break
# Get additional information # Get additional information
# if tag == 'wikipedia' : # if tag == 'wikipedia' :
@ -352,14 +352,14 @@ class LandmarkManager:
score = score_function(score) score = score_function(score)
if "place_of_worship" in elem.tags().values() : if "place_of_worship" in elem.tags().values() :
score = int(score*self.church_coeff) score = int(score*self.church_coeff)
duration = 20 duration = 15
elif "museum" in elem.tags().values() : elif "museum" in elem.tags().values() :
score = int(score*self.church_coeff) score = int(score*self.church_coeff)
duration = 60 duration = 60
else : else :
duration = 30 duration = 5
# Generate the landmark and append it to the list # Generate the landmark and append it to the list
landmark = Landmark( landmark = Landmark(

View File

@ -193,7 +193,7 @@ class Optimizer:
for j, spot2 in enumerate(landmarks) : for j, spot2 in enumerate(landmarks) :
t = get_time(spot1.location, spot2.location) + spot1.duration t = get_time(spot1.location, spot2.location) + spot1.duration
dist_table[j] = t dist_table[j] = t
closest = sorted(dist_table)[:22] closest = sorted(dist_table)[:20]
for i, dist in enumerate(dist_table) : for i, dist in enumerate(dist_table) :
if dist not in closest : if dist not in closest :
dist_table[i] = 32700 dist_table[i] = 32700