Files
PythonRobotics/tests/test_a_star_variants.py
Atsushi Sakai 2bf0dcedc9 fix unittest animation bugs (#429)
* fix unittest animation bugs

* exstract a function
2020-11-01 14:05:46 +09:00

51 lines
1.2 KiB
Python

import PathPlanning.AStar.a_star_variants as astar
from unittest import TestCase
import sys
import os
sys.path.append(os.path.dirname(__file__) + "/../")
class Test(TestCase):
def test(self):
# A* with beam search
astar.show_animation = False
astar.use_beam_search = True
astar.main()
self.reset_all()
# A* with iterative deepening
astar.use_iterative_deepening = True
astar.main()
self.reset_all()
# A* with dynamic weighting
astar.use_dynamic_weighting = True
astar.main()
self.reset_all()
# theta*
astar.use_theta_star = True
astar.main()
self.reset_all()
# A* with jump point
astar.use_jump_point = True
astar.main()
self.reset_all()
@staticmethod
def reset_all():
astar.show_animation = False
astar.use_beam_search = False
astar.use_iterative_deepening = False
astar.use_dynamic_weighting = False
astar.use_theta_star = False
astar.use_jump_point = False
if __name__ == '__main__': # pragma: no cover
test = Test()
test.test()