diff options
-rw-r--r-- | src/main/java/fr/umlv/java/wallj/board/PathFinder.java | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/main/java/fr/umlv/java/wallj/board/PathFinder.java b/src/main/java/fr/umlv/java/wallj/board/PathFinder.java index dfd1fa6..098b4a2 100644 --- a/src/main/java/fr/umlv/java/wallj/board/PathFinder.java +++ b/src/main/java/fr/umlv/java/wallj/board/PathFinder.java | |||
@@ -73,11 +73,11 @@ public class PathFinder { | |||
73 | 73 | ||
74 | double challengeCost = cost(searchData, current) + neighborEntry.getValue(); | 74 | double challengeCost = cost(searchData, current) + neighborEntry.getValue(); |
75 | double currentCost = cost(searchData, neighborEntry.getKey()); | 75 | double currentCost = cost(searchData, neighborEntry.getKey()); |
76 | if (challengeCost < currentCost) | 76 | if (challengeCost < currentCost) { |
77 | searchData.put(neighborEntry.getKey(), new NodeSearchData<>(current, challengeCost, | 77 | searchData.put(neighborEntry.getKey(), new NodeSearchData<>(current, challengeCost, |
78 | challengeCost + heuristic.apply(neighborEntry.getKey().val, target))); | 78 | challengeCost + heuristic.apply(neighborEntry.getKey().val, target))); |
79 | 79 | discovered.add(neighborEntry.getKey()); | |
80 | discovered.add(neighborEntry.getKey()); | 80 | } |
81 | } | 81 | } |
82 | 82 | ||
83 | visited.add(current); | 83 | visited.add(current); |