/** * create a new node and add queue if the new node cost is less than the current cost * * @param currNode * @param x * @param y */ protected boolean checkAndAddNodeToList(Node currNode, int x, int y) { int cost = currNode.getCurrentPathCost() + 1; int h = 0; // heuristic(x,y); if (h + cost < this.maze[x][y]) { this.pq.add(new Node(currNode, x, y, cost, h)); this.maze[x][y] = h + cost; this.expands++; return true; } return false; }