public void dequeue() { if (front != null) { front = front.getNext(); } else { rear = null; } }
public String display() { String nodes = ""; AStarNode temp = front; while (temp != null) { nodes += temp.getData() + " "; temp = temp.getNext(); } return(nodes); }
public double getHeuristic(int data) { double heuristic = 0; AStarNode temp = front; while (temp != null) { if (data == temp.getData()) { heuristic = temp.getHeuristic(); break; } else { temp = temp.getNext(); } } return(heuristic); }
public bool isVisited(int data) { bool flag = false; AStarNode temp = front; while (temp != null) { if (data == temp.getData()) { flag = true; break; } else { temp = temp.getNext(); } } return(flag); }
public int compare() { int node = 0; double function = 0; if (front != null) { AStarNode temp = front.getNext(); function = front.getFunction(); node = front.getData(); while (temp != null) { if (temp.getFunction() < function) { function = temp.getFunction(); node = temp.getData(); } temp = temp.getNext(); } } return(node); }