added duration
All checks were successful
Build and push docker image / Build (pull_request) Successful in 1m30s
All checks were successful
Build and push docker image / Build (pull_request) Successful in 1m30s
This commit is contained in:
parent
da921171e9
commit
a1fcc8d23b
@ -291,6 +291,7 @@ class LandmarkManager:
|
||||
n_tags = len(elem.tags().keys()) # Add number of tags
|
||||
score = n_tags**self.tag_exponent # Add score
|
||||
|
||||
|
||||
# remove specific tags
|
||||
skip = False
|
||||
for tag in elem.tags().keys():
|
||||
@ -336,6 +337,14 @@ class LandmarkManager:
|
||||
score = score_function(score)
|
||||
if "place_of_worship" in elem.tags().values() :
|
||||
score = int(score*self.church_coeff)
|
||||
duration = 20
|
||||
|
||||
elif "museum" in elem.tags().values() :
|
||||
score = int(score*self.church_coeff)
|
||||
duration = 60
|
||||
|
||||
else :
|
||||
duration = 30
|
||||
|
||||
# Generate the landmark and append it to the list
|
||||
landmark = Landmark(
|
||||
@ -346,7 +355,8 @@ class LandmarkManager:
|
||||
osm_id=osm_id,
|
||||
attractiveness=score,
|
||||
must_do=False,
|
||||
n_tags=int(n_tags)
|
||||
n_tags=int(n_tags),
|
||||
duration = duration
|
||||
)
|
||||
return_list.append(landmark)
|
||||
|
||||
|
@ -191,7 +191,7 @@ class Optimizer:
|
||||
dist_table = [0]*len(landmarks)
|
||||
c.append(-spot1.attractiveness)
|
||||
for j, spot2 in enumerate(landmarks) :
|
||||
t = get_time(spot1.location, spot2.location)
|
||||
t = get_time(spot1.location, spot2.location) + spot1.duration
|
||||
dist_table[j] = t
|
||||
closest = sorted(dist_table)[:22]
|
||||
for i, dist in enumerate(dist_table) :
|
||||
|
Loading…
x
Reference in New Issue
Block a user