Skip to content

Commit

Permalink
Simplify A* option handling
Browse files Browse the repository at this point in the history
  • Loading branch information
blegat committed Aug 27, 2021
1 parent 0dcc84d commit c01a862
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions src/routing.jl
Original file line number Diff line number Diff line change
Expand Up @@ -158,12 +158,10 @@ function find_route(m::MapData, node0::Int, node1::Int,
route_indices, route_values = OpenStreetMapX.extract_route(dijkstra_result, start_vertex, finish_vertex)
route_nodes = OpenStreetMapX.get_route_nodes(m, route_indices)
push!(result, route_nodes, route_values)
elseif routing == :astar
route_indices, route_values = OpenStreetMapX.a_star_algorithm(m.g, start_vertex, finish_vertex, weights, heuristic)
route_nodes = OpenStreetMapX.get_route_nodes(m, route_indices)
push!(result, route_nodes, route_values)
else
@warn "routing module declared wrongly - a star algorithm will be used instead!"
if routing != :astar
@warn "routing module declared wrongly - a star algorithm will be used instead!"
end
route_indices, route_values = OpenStreetMapX.a_star_algorithm(m.g, start_vertex, finish_vertex, weights, heuristic)
route_nodes = OpenStreetMapX.get_route_nodes(m, route_indices)
push!(result, route_nodes, route_values)
Expand Down

0 comments on commit c01a862

Please sign in to comment.