diff --git a/backend/src/structs/landmarks.py b/backend/src/structs/landmarks.py index 71111a1..f6db9ac 100644 --- a/backend/src/structs/landmarks.py +++ b/backend/src/structs/landmarks.py @@ -1,6 +1,5 @@ -from typing import Optional +from typing import Optional, Literal from pydantic import BaseModel, Field -from .landmarktype import LandmarkType from uuid import uuid4 @@ -9,7 +8,7 @@ class Landmark(BaseModel) : # Properties of the landmark name : str - type: LandmarkType # De facto mapping depending on how the query was executed with overpass. Should still EXACTLY correspond to the preferences + type: Literal['sightseeing', 'nature', 'shopping'] location : tuple osm_type : str osm_id : int @@ -24,10 +23,15 @@ class Landmark(BaseModel) : # Additional properties depending on specific tour must_do : bool + must_avoid : bool is_secondary : Optional[bool] = False # TODO future time_to_reach_next : Optional[int] = 0 # TODO fix this in existing code next_uuid : Optional[str] = None # TODO implement this ASAP def __hash__(self) -> int: - return self.uuid.int \ No newline at end of file + return self.uuid.int + + def __str__(self) -> str: + return f'Landmark: [{self.name}, {self.location}, {self.attractiveness}]' + diff --git a/backend/src/structs/landmarktype.py b/backend/src/structs/landmarktype.py deleted file mode 100644 index 8a63a1b..0000000 --- a/backend/src/structs/landmarktype.py +++ /dev/null @@ -1,4 +0,0 @@ -from pydantic import BaseModel - -class LandmarkType(BaseModel): - landmark_type: str \ No newline at end of file diff --git a/backend/src/structs/preferences.py b/backend/src/structs/preferences.py index 500ebec..ff25007 100644 --- a/backend/src/structs/preferences.py +++ b/backend/src/structs/preferences.py @@ -1,9 +1,9 @@ from pydantic import BaseModel -from .landmarktype import LandmarkType +from typing import Optional, Literal class Preference(BaseModel) : name: str - type: LandmarkType # should match the attributes of the Preferences class + type: Literal['sightseeing', 'nature', 'shopping'] score: int # score could be from 1 to 5 # Input for optimization @@ -17,12 +17,5 @@ class Preferences(BaseModel) : # Shopping (diriger plutôt vers des zones / rues commerçantes) shopping : Preference -""" # Food (price low or high. Combien on veut dépenser pour manger à midi/soir) - food_budget : Preference - - # Tolérance au détour (ce qui détermine (+ ou -) le chemin emprunté) - detour_tol : Preference""" - - - - + max_time_minute: Optional[int] = 6*60 + detour_tolerance_minute: Optional[int] = 0