Cleanup and created main
Some checks failed
Test code / Test code (push) Failing after 2s

This commit is contained in:
2024-05-22 10:16:33 +02:00
parent 82a864e57f
commit 2b31ce5f6b
4 changed files with 100 additions and 115 deletions

View File

@@ -1,23 +1,26 @@
import fastapi
from dataclasses import dataclass
from optimizer import solve_optimization
from optimizer import landmark
def main():
# CONSTRAINT TO RESPECT MAX NUMBER OF STEPS
max_steps = 16
@dataclass
class Destination:
name: str
location: tuple
attractiveness: int
# Initialize all landmarks (+ start and goal). Order matters here
landmarks = []
landmarks.append(landmark("départ", -1, (0, 0)))
landmarks.append(landmark("tour eiffel", 99, (0,2))) # PUT IN JSON
landmarks.append(landmark("arc de triomphe", 99, (0,4)))
landmarks.append(landmark("louvre", 99, (0,6)))
landmarks.append(landmark("montmartre", 99, (0,10)))
landmarks.append(landmark("concorde", 99, (0,8)))
landmarks.append(landmark("arrivée", -1, (0, 0)))
visiting_order = solve_optimization(landmarks, max_steps, True)
d = Destination()
def get_route() -> list[Destination]:
return {"route": "Hello World"}
endpoint = ("/get_route", get_route)
end
if __name__ == "__main__":
fastapi.run()
main()