fix part of oscillation
This commit is contained in:
parent
791eb886c0
commit
3c25e2b685
@ -169,6 +169,9 @@ public class AStarPathFinder extends AbstractNodeCostSearch implements Helper {
|
||||
for (int i = 0; i < bestSoFar.length; i++) {
|
||||
double heuristic = neighbor.estimatedCostToGoal + neighbor.cost / COEFFICIENTS[i];
|
||||
if (heuristic < bestHeuristicSoFar[i]) {
|
||||
if (bestHeuristicSoFar[i] - heuristic < 0.01 && minimumImprovementRepropagation) {
|
||||
continue;
|
||||
}
|
||||
bestHeuristicSoFar[i] = heuristic;
|
||||
bestSoFar[i] = neighbor;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user