mirror of
https://github.com/AtsushiSakai/PythonRobotics.git
synced 2026-04-22 03:00:22 -04:00
Update greedy_best_first_search - calc_final_path method (#477)
* Update greedy_best_first_search.py parent_index should be pind. other wise it cann't work * add breadth first search test * Add greedy best first search test
This commit is contained in:
@@ -132,7 +132,7 @@ class BestFirstSearchPlanner:
|
||||
# generate final course
|
||||
rx, ry = [self.calc_grid_position(ngoal.x, self.minx)], [
|
||||
self.calc_grid_position(ngoal.y, self.miny)]
|
||||
n = closedset[ngoal.parent_index]
|
||||
n = closedset[ngoal.pind]
|
||||
while n is not None:
|
||||
rx.append(self.calc_grid_position(n.x, self.minx))
|
||||
ry.append(self.calc_grid_position(n.y, self.miny))
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
import conftest
|
||||
from PathPlanning.BreadthFirstSearch import breadth_first_search as m
|
||||
|
||||
|
||||
def test_1():
|
||||
m.show_animation = False
|
||||
m.main()
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
conftest.run_this_test(__file__)
|
||||
import conftest
|
||||
from PathPlanning.BreadthFirstSearch import breadth_first_search as m
|
||||
|
||||
|
||||
def test_1():
|
||||
m.show_animation = False
|
||||
m.main()
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
conftest.run_this_test(__file__)
|
||||
|
||||
11
tests/test_greedy_best_first_search.py
Normal file
11
tests/test_greedy_best_first_search.py
Normal file
@@ -0,0 +1,11 @@
|
||||
import conftest
|
||||
from PathPlanning.GreedyBestFirstSearch import greedy_best_first_search as m
|
||||
|
||||
|
||||
def test_1():
|
||||
m.show_animation = False
|
||||
m.main()
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
conftest.run_this_test(__file__)
|
||||
Reference in New Issue
Block a user