anyway/backend/src/structs/preferences.py
Helldragon67 41e2746d82
Some checks failed
Build and deploy the backend to staging / Build and push image (pull_request) Successful in 1m48s
Run linting on the backend code / Build (pull_request) Failing after 29s
Run testing on the backend code / Build (pull_request) Failing after 1m13s
Build and deploy the backend to staging / Deploy to staging (pull_request) Successful in 47s
more testing and better pylint score
2024-11-30 17:55:33 +01:00

35 lines
964 B
Python

"""Defines the Preferences used as input for trip generation."""
from typing import Optional, Literal
from pydantic import BaseModel
class Preference(BaseModel) :
"""
Type of preference.
Attributes:
type: what kind of landmark type.
score: how important that type is.
"""
type: Literal['sightseeing', 'nature', 'shopping', 'start', 'finish']
score: int # score could be from 1 to 5
# Input for optimization
class Preferences(BaseModel) :
""""
Full collection of preferences needed to generate a personalized trip.
"""
# 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
max_time_minute: Optional[int] = 3*60
detour_tolerance_minute: Optional[int] = 0