les 3 micro changements (rééquilibrage)

This commit is contained in:
Helldragon67 2024-08-05 16:17:19 +02:00
parent 8a62e68ddd
commit 097c3cccdd
3 changed files with 7 additions and 3 deletions

View File

@ -13,7 +13,7 @@ class Landmark(BaseModel) :
osm_type : str
osm_id : int
attractiveness : int
n_tags : int
n_tags : float
image_url : Optional[str] = None # TODO future
description : Optional[str] = None # TODO future
duration : Optional[int] = 0 # TODO future

View File

@ -321,9 +321,9 @@ class LandmarkManager:
if elem_type != "nature":
if "leisure" in tag and elem.tag('leisure') == "park":
elem_type = "nature"
if elem_type == "nature":
n_tags += 1
n_tags += 1.5
if landmarktype != SHOPPING:
if "shop" in tag:

View File

@ -2,6 +2,10 @@ from structs.landmark import Landmark
def take_most_important(landmarks: list[Landmark], N_important) -> list[Landmark] :
L = len(landmarks)
if L < N_important :
return landmarks
L_copy = []
L_clean = []
scores = [0]*len(landmarks)