entur / OpenTripPlanner

An open source multi-modal trip planner
http://www.opentripplanner.org
Other
25 stars 10 forks source link

Otp2 cleanup routing service #75

Closed t2gran closed 4 years ago

t2gran commented 4 years ago

This build on top of implement dynamic computation of EDT, LAT and SearchWindow. This should not be merged before the other is merged.

This PR is cleaning up the Routing services and make a singe entry point for routing the RoutingWorker. This worker delegate the street and transit routing to the AStar and Raptor. Also it take a RoutingRequest and return a TripPlan. It delegates the mapping of paths to Itineraries to its mappers.

This refactoring is necessary to allow us to have a common core model used by multiple API endpoints, which then should have their own API DTOs (Data Transfer Object - design pattern).

This also allow us to extend the core model and add extra information without breaking API compatibility.

NB! Since I merged the routing code in TransmodelGrapQLRouter and PlannerResource I used the BEST CODE from both, possibly slightly changing small stuff. E.g. when a path can not be found it is NOT considered an ERROR any more, and no error message is added to the result. The client should detect that the list of itineraries is empty. Not that in some cases this was the existing behavior, but know the route() method is consistent. Also, some possible NPE is fixed when no vertexes is found - this would only occur for some obscure parameters values. I have not created tests to verify the failures - so I am not 100% sure they existed, but the code should be more robust now.

t2gran commented 4 years ago

This PR was created as a mistake -The PR end up in Enturs GitRepo even if it is created from the upstream OTP repo. To create PRs based on a branch witch is not merged into the main repo, we need to use otp/dev-2.x as a base - if not the PR en up in the repo.

t2gran commented 4 years ago

This is merged into dev-2.x