possibly fix oscillation problem with a large goal composite

This commit is contained in:
Leijurv 2018-09-19 19:34:05 -07:00
parent 1790534421
commit 2e63ac41d9
No known key found for this signature in database
GPG Key ID: 44A3EA646EADAC6A

View File

@ -68,7 +68,8 @@ public class AStarPathFinder extends AbstractNodeCostSearch implements Helper {
bestSoFar = new PathNode[COEFFICIENTS.length];//keep track of the best node by the metric of (estimatedCostToGoal + cost / COEFFICIENTS[i]) bestSoFar = new PathNode[COEFFICIENTS.length];//keep track of the best node by the metric of (estimatedCostToGoal + cost / COEFFICIENTS[i])
double[] bestHeuristicSoFar = new double[COEFFICIENTS.length]; double[] bestHeuristicSoFar = new double[COEFFICIENTS.length];
for (int i = 0; i < bestHeuristicSoFar.length; i++) { for (int i = 0; i < bestHeuristicSoFar.length; i++) {
bestHeuristicSoFar[i] = Double.MAX_VALUE; bestHeuristicSoFar[i] = startNode.estimatedCostToGoal;
bestSoFar[i] = startNode;
} }
CalculationContext calcContext = new CalculationContext(); CalculationContext calcContext = new CalculationContext();
HashSet<BetterBlockPos> favored = favoredPositions.orElse(null); HashSet<BetterBlockPos> favored = favoredPositions.orElse(null);