this is just not possible

This commit is contained in:
Leijurv 2018-11-24 22:04:36 -08:00
parent ba5c8ffaa6
commit 93217a3ae3
No known key found for this signature in database
GPG Key ID: 44A3EA646EADAC6A

View File

@ -143,9 +143,6 @@ public final class AStarPathFinder extends AbstractNodeCostSearch implements Hel
PathNode neighbor = getNodeAtPosition(res.x, res.y, res.z, hashCode); PathNode neighbor = getNodeAtPosition(res.x, res.y, res.z, hashCode);
double tentativeCost = currentNode.cost + actionCost; double tentativeCost = currentNode.cost + actionCost;
if (tentativeCost < neighbor.cost) { if (tentativeCost < neighbor.cost) {
if (tentativeCost < 0) {
throw new IllegalStateException(moves + " overflowed into negative " + actionCost + " " + neighbor.cost + " " + tentativeCost);
}
double improvementBy = neighbor.cost - tentativeCost; double improvementBy = neighbor.cost - tentativeCost;
// there are floating point errors caused by random combinations of traverse and diagonal over a flat area // there are floating point errors caused by random combinations of traverse and diagonal over a flat area
// that means that sometimes there's a cost improvement of like 10 ^ -16 // that means that sometimes there's a cost improvement of like 10 ^ -16