fixed input as coordinates
Some checks failed
Build and push docker image / Build (pull_request) Failing after 36s
Build and release APK / Build APK (pull_request) Successful in 5m20s
Build web / Build Web (pull_request) Successful in 1m13s

This commit is contained in:
2024-06-04 00:20:54 +02:00
parent bcc91c638d
commit c58c10b057
7 changed files with 274 additions and 80 deletions

67
backend/src/tester.py Normal file
View File

@@ -0,0 +1,67 @@
from optimizer import solve_optimization
from landmarks_manager import generate_landmarks
from structs.landmarks import LandmarkTest
from structs.landmarks import Landmark
from structs.landmarktype import LandmarkType
from structs.preferences import Preferences, Preference
from fastapi import FastAPI, Query, Body
from typing import List
def test3(city_country: str) -> List[Landmark]:
preferences = Preferences(
sightseeing=Preference(
name='sightseeing',
type=LandmarkType(landmark_type='sightseeing'),
score = 5),
nature=Preference(
name='nature',
type=LandmarkType(landmark_type='nature'),
score = 0),
shopping=Preference(
name='shopping',
type=LandmarkType(landmark_type='shopping'),
score = 5))
landmarks = generate_landmarks(city_country, preferences)
max_steps = 9
visiting_order = solve_optimization(landmarks, max_steps, True)
print(len(visiting_order))
return len(visiting_order)
def test4(coordinates: tuple[float, float]) -> List[Landmark]:
preferences = Preferences(
sightseeing=Preference(
name='sightseeing',
type=LandmarkType(landmark_type='sightseeing'),
score = 5),
nature=Preference(
name='nature',
type=LandmarkType(landmark_type='nature'),
score = 0),
shopping=Preference(
name='shopping',
type=LandmarkType(landmark_type='shopping'),
score = 5))
landmarks = generate_landmarks(coordinates, preferences)
max_steps = 90
visiting_order = solve_optimization(landmarks, max_steps, True)
print(len(visiting_order))
return len(visiting_order)
test3(tuple((48.834378, 2.322113)))