cleaned up folders and defined proper structs
This commit is contained in:
24
backend/src/structs/landmarks.py
Normal file
24
backend/src/structs/landmarks.py
Normal file
@@ -0,0 +1,24 @@
|
||||
from pydantic import BaseModel
|
||||
from .landmarktype import LandmarkType
|
||||
from .preferences import Preferences
|
||||
|
||||
class LandmarkTest(BaseModel) :
|
||||
name : str
|
||||
attractiveness : int
|
||||
loc : tuple
|
||||
|
||||
# Output to frontend
|
||||
class Landmark(BaseModel) :
|
||||
name : str
|
||||
type: LandmarkType # De facto mapping depending on how the query was executed with overpass. Should still EXACTLY correspond to the preferences
|
||||
location : tuple
|
||||
|
||||
|
||||
def score(preferences: Preferences):
|
||||
# loop through the preferences and assign a score
|
||||
|
||||
|
||||
return 29
|
||||
|
||||
|
||||
|
4
backend/src/structs/landmarktype.py
Normal file
4
backend/src/structs/landmarktype.py
Normal file
@@ -0,0 +1,4 @@
|
||||
from pydantic import BaseModel
|
||||
|
||||
class LandmarkType(BaseModel):
|
||||
landmark_type: str
|
28
backend/src/structs/preferences.py
Normal file
28
backend/src/structs/preferences.py
Normal file
@@ -0,0 +1,28 @@
|
||||
from pydantic import BaseModel
|
||||
from .landmarktype import LandmarkType
|
||||
|
||||
class Preference(BaseModel) :
|
||||
name: str
|
||||
type: LandmarkType
|
||||
score: int
|
||||
|
||||
# Input for optimization
|
||||
class Preferences(BaseModel) :
|
||||
# Sightseeing / History & Culture (Musées, bâtiments historiques, opéras, églises)
|
||||
sightseeing : Preference
|
||||
|
||||
# Nature (parcs, jardins, rivières, plages)
|
||||
nature: Preference
|
||||
|
||||
# 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
|
||||
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user