This commit is contained in:
@@ -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()
|
||||
Reference in New Issue
Block a user