les 3 micro changements (rééquilibrage)
This commit is contained in:
parent
8a62e68ddd
commit
097c3cccdd
@ -13,7 +13,7 @@ class Landmark(BaseModel) :
|
|||||||
osm_type : str
|
osm_type : str
|
||||||
osm_id : int
|
osm_id : int
|
||||||
attractiveness : int
|
attractiveness : int
|
||||||
n_tags : int
|
n_tags : float
|
||||||
image_url : Optional[str] = None # TODO future
|
image_url : Optional[str] = None # TODO future
|
||||||
description : Optional[str] = None # TODO future
|
description : Optional[str] = None # TODO future
|
||||||
duration : Optional[int] = 0 # TODO future
|
duration : Optional[int] = 0 # TODO future
|
||||||
|
@ -321,9 +321,9 @@ class LandmarkManager:
|
|||||||
if elem_type != "nature":
|
if elem_type != "nature":
|
||||||
if "leisure" in tag and elem.tag('leisure') == "park":
|
if "leisure" in tag and elem.tag('leisure') == "park":
|
||||||
elem_type = "nature"
|
elem_type = "nature"
|
||||||
|
|
||||||
if elem_type == "nature":
|
if elem_type == "nature":
|
||||||
n_tags += 1
|
n_tags += 1.5
|
||||||
|
|
||||||
if landmarktype != SHOPPING:
|
if landmarktype != SHOPPING:
|
||||||
if "shop" in tag:
|
if "shop" in tag:
|
||||||
|
@ -2,6 +2,10 @@ from structs.landmark import Landmark
|
|||||||
|
|
||||||
def take_most_important(landmarks: list[Landmark], N_important) -> list[Landmark] :
|
def take_most_important(landmarks: list[Landmark], N_important) -> list[Landmark] :
|
||||||
L = len(landmarks)
|
L = len(landmarks)
|
||||||
|
|
||||||
|
if L < N_important :
|
||||||
|
return landmarks
|
||||||
|
|
||||||
L_copy = []
|
L_copy = []
|
||||||
L_clean = []
|
L_clean = []
|
||||||
scores = [0]*len(landmarks)
|
scores = [0]*len(landmarks)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user