A* search algorithm: Difference between revisions

Content added Content deleted
Line 1,963: Line 1,963:
* @return : cost from current node to goal. use Manhattan distance.
* @return : cost from current node to goal. use Manhattan distance.
*/
*/
public int calculateCost(Coord goal){
public int calculateCost(Mazecoord goal){
int rState = this.getR();
int rState = this.getR();
int rGoal = goal.getR();
int rGoal = goal.getR();
Line 1,979: Line 1,979:
}
}


public void setFather(Coord node){
public void setFather(Mazecoord node){
this.father = node;
this.father = node;
}
}


public int getDeep() {
public int getAStartCost() {
return deep;
return AStartCost;
}
}


public void setDeep(int deep) {
public void setAStartCost(int aStartCost) {
this.deep = deep;
AStartCost = aStartCost;
}
}