Closed bartoszpankratz closed 5 years ago
@bartoszpankratz - build failed:
ERROR: LoadError: ArgumentError: Package OpenStreetMapX does not have DataStructures in its dependencies:
Do you know how to add the dependency or need help?
Nope, any help will be very appreciated.
@bartoszpankratz I have fixed the dependencies. However what is missing:
shortest_route
and fastest_route
methods. a_star should be used by default. I propose adding a new parameter to those methods ; routing = :astar
and the user should be able to change ; routing = :dijkstra
if they wanted the classic Dijkstra
. @test shortest_route(m, pointA, pointB; routing = :astar) == shortest_route(m, pointA, pointB; routing = :dijkstra)
@test fastest_route(m, pointA, pointB; routing = :astar) == fastest_route(m, pointA, pointB; routing = :dijkstra)
I assume that those tests should pass.
Done
@bartoszpankratz tests now are failing for the fastest_route we need to adjust the heuristic function for a_start to calculate in this case the shortest theoretical travel time. Probably now it is still calculating distance - so for fastest_route we it needs to be divided by the travel speed.
@pszufe I know it. An it was one of the reasons why I insisting on keeping the zeros heuristic during the phone call. It is the only universal one, and If you need something more sophisticated declaring new one is easy and absolutely basic. Straight Line heurisic is proper only for the shortest path searching, for the driving time you need to create another large matrix (speeds matrix) and it still will be sometimes unnefective (for segments faster than average speed the heuristic value might be larger than the value of the route, so algorithm will return unoptimal path).
I have modified this heuristic, now it is dividing not by not average but maximum possible speed. IMHO it is quite unnatural but works - it will never overestimate the cost of the route. I guess case is done.
This PR is becoming unmanageably large (almost 300 LOC). @bartoszpankratz - is it possible to split it into two parts:
@bartoszpankratz - build failed:
Do you know how to add the dependency or need help?