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( |
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( |
public void setFather(Mazecoord node){ |
||
this.father = node; |
this.father = node; |
||
} |
} |
||
public int getAStartCost() { |
|||
return |
return AStartCost; |
||
} |
} |
||
public void |
public void setAStartCost(int aStartCost) { |
||
AStartCost = aStartCost; |
|||
} |
} |
||