Skip to content

Commit

Permalink
Update routing.jl
Browse files Browse the repository at this point in the history
  • Loading branch information
bartoszpankratz committed Mar 10, 2019
1 parent 0bb7925 commit bf05295
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/routing.jl
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ function fastest_route(m::MapData, node1::Int, node2::Int;
w = OpenStreetMapX.create_weights_matrix(m,network_travel_times(m, speeds))
route_nodes, route_time, distance = OpenStreetMapX.find_route(m, node1, node2, w,
routing = routing,
heuristic = (u,v) -> OpenStreetMapX.get_distance(u, v, m.nodes, m.n) / Statistics.mean(SparseArrays.nonzeros(OpenStreetMapX.get_velocities(m))),
heuristic = (u,v) -> OpenStreetMapX.get_distance(u, v, m.nodes, m.n) / maximum(values(speeds)),
get_distance = true, get_time = false)
return route_nodes, distance, route_time
end
Expand All @@ -285,7 +285,7 @@ function fastest_route(m::MapData, node1::Int, node2::Int, node3::Int;
speeds::Dict{Int,Float64}=SPEED_ROADS_URBAN)
w = OpenStreetMapX.create_weights_matrix(m,network_travel_times(m, speeds))
route_nodes, route_time, distance = OpenStreetMapX.find_route(m, node1, node2, node3, w,
routing = routing, heuristic = (u,v) -> OpenStreetMapX.get_distance(u, v, m.nodes, m.n) / Statistics.mean(SparseArrays.nonzeros(OpenStreetMapX.get_velocities(m))),
routing = routing, heuristic = (u,v) -> OpenStreetMapX.get_distance(u, v, m.nodes, m.n) / maximum(values(speeds)),
get_distance = true, get_time = false)
return route_nodes, distance, route_time
end
Expand Down

0 comments on commit bf05295

Please sign in to comment.