PathPlanning
PathPlanning copied to clipboard
既然都继承了,为什么还写那么多重复的代码呢?
BFS、DFS、Dijkstra等均继承自AStar,searching方法大同小异,只不过priority的计算方式不同,为什么不抽象出来呢,这样也方便理解不同方法是如何组合演化的? 例如f(n)=g(n)+w*h(n):
- w=1时,就是AStar
- w=0时,就是Dijkstra
- w=1且g(n)=0时,就是Best First
to keep code independent and easy maybe. And the 'open list' in BFS should be simply a list instead of a heap, entend is not a good idea