fixed optimizer. works fine now
This commit is contained in:
@@ -12,13 +12,13 @@ app = FastAPI()
|
||||
|
||||
# Assuming frontend is calling like this :
|
||||
#"http://127.0.0.1:8000/process?param1={param1}¶m2={param2}"
|
||||
# This should become main at some point
|
||||
@app.post("/optimizer/{longitude}/{latitude}")
|
||||
def main(longitude: float, latitude: float, preferences: Preferences = Body(...)) -> List[Landmark]:
|
||||
@app.post("/optimizer_coords/{longitude}/{latitude}/{city_country}")
|
||||
def main1(preferences: Preferences = Body(...), longitude: float = None, latitude: float = None, city_country: str = None) -> List[Landmark]:
|
||||
|
||||
# From frontend get longitude, latitude and prefence list
|
||||
|
||||
# Generate the landmark list
|
||||
landmarks = generate_landmarks(tuple((longitude, latitude)), preferences)
|
||||
landmarks = generate_landmarks(preferences=preferences, city_country=city_country, coordinates=tuple((longitude, latitude)))
|
||||
|
||||
# Set the max distance
|
||||
max_steps = 90
|
||||
|
||||
Reference in New Issue
Block a user