This commit is contained in:
Ziver Koc 2007-04-17 15:55:22 +00:00
parent 98cd3b8287
commit 0bfc621ade
6 changed files with 32 additions and 20 deletions

View file

@ -9,7 +9,7 @@ import ei.game.algo.AStarNeighbour.Location;
*/
public class AStarNode2D extends AStarNode {
protected final static float adjacentCost = 1;
protected final static float diagonalCost = (float)Math.sqrt(2)*adjacentCost+1;
protected final static float diagonalCost = (float)Math.sqrt(2)*adjacentCost;
protected final static float tieBreaker = adjacentCost/(1024f/1024f);
public enum Heuristic {