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
|
n_tags = len(elem.tags().keys()) # Add number of tags
|
||||||
score = n_tags**self.tag_exponent # Add score
|
score = n_tags**self.tag_exponent # Add score
|
||||||
|
|
||||||
|
|
||||||
# remove specific tags
|
# remove specific tags
|
||||||
skip = False
|
skip = False
|
||||||
for tag in elem.tags().keys():
|
for tag in elem.tags().keys():
|
||||||
@ -336,6 +337,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
|
||||||
|
|
||||||
|
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
|
# Generate the landmark and append it to the list
|
||||||
landmark = Landmark(
|
landmark = Landmark(
|
||||||
@ -346,7 +355,8 @@ class LandmarkManager:
|
|||||||
osm_id=osm_id,
|
osm_id=osm_id,
|
||||||
attractiveness=score,
|
attractiveness=score,
|
||||||
must_do=False,
|
must_do=False,
|
||||||
n_tags=int(n_tags)
|
n_tags=int(n_tags),
|
||||||
|
duration = duration
|
||||||
)
|
)
|
||||||
return_list.append(landmark)
|
return_list.append(landmark)
|
||||||
|
|
||||||
|
@ -191,7 +191,7 @@ class Optimizer:
|
|||||||
dist_table = [0]*len(landmarks)
|
dist_table = [0]*len(landmarks)
|
||||||
c.append(-spot1.attractiveness)
|
c.append(-spot1.attractiveness)
|
||||||
for j, spot2 in enumerate(landmarks) :
|
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
|
dist_table[j] = t
|
||||||
closest = sorted(dist_table)[:22]
|
closest = sorted(dist_table)[:22]
|
||||||
for i, dist in enumerate(dist_table) :
|
for i, dist in enumerate(dist_table) :
|
||||||
|
Loading…
x
Reference in New Issue
Block a user