One way to test a router is to write a main method for it in Python. For example, at the end of orienteering_router.py, there is a short main() method that tests the router.
Once that's working, this is another way to test the router that integrates the whole Python route planner.
Setup
reqdatais the request to send to the route planner.- The script will print out the response object.
Usage
- Run the route planner's
start_server.py. node client.js
Notes
- Through the magic of gRPC, a call to
stub.PlanRoutein the client is equivalent to a call toRoutePlanner.PlanRouteinstart_server.py.RoutePlanner.PlanRoutechooses which router is called. - Thus, for a router X to be called in the backend, first the logic to dispatch to X must be added to
RoutePlanner.PlanRouteinstart_server.py. Then, the request data must meet the requirements to dispatch to X.