Skip to content

Commit

Permalink
fix cons_path call
Browse files Browse the repository at this point in the history
goal may be a function now, so it needs to be called with the vertex `x`
  • Loading branch information
whossname authored and wkhere committed Aug 30, 2019
1 parent 24e3455 commit 89a6f4f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/astar.ex
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ defmodule Astar do
defp loop({nbs, dist, h}=env, goal, openmap, closedset, parents) do
{_fx, x, openmap} = HeapMap.pop(openmap)
if has_reached_goal?(x, goal) do
cons_path(parents, goal)
cons_path(parents, x)
else

closedset = MapSet.put(closedset, x)
Expand Down

0 comments on commit 89a6f4f

Please sign in to comment.