Skip to content

Commit 90dac70

Browse files
committed
Changed main function name to a_star_search
1 parent e9472ef commit 90dac70

File tree

4 files changed

+5
-5
lines changed

4 files changed

+5
-5
lines changed

a_star/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
__author__ = 'Pablo Galindo Salgado'
22

3-
from .a_star import a_star,Node,DijkstraHeap
3+
from .a_star import a_star_search,Node,DijkstraHeap

a_star/a_star.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ def pop(self):
6767

6868
Node = collections.namedtuple("Node","cost point came_from")
6969

70-
def a_star(graph, start, end):
70+
def a_star_search(graph, start, end):
7171
"""
7272
Calculates the shortest path from start to end.
7373

examples/maze_solving_example.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ def from_id_width(point, width):
4141
(7, 3), (7, 4), (7, 5)]}
4242

4343
# Call the A* algorithm and get the frontier
44-
frontier = a_star.a_star(graph = graph, start=(1, 4), end=(7, 8))
44+
frontier = a_star.a_star_search(graph = graph, start=(1, 4), end=(7, 8))
4545

4646
# Print the results
4747

tests/test_maze.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ def test_maze_1(self):
2626
start = (0,2)
2727

2828
# Call the A* algorithm and get the frontier
29-
frontier = a_star.a_star(graph = maze, start=start, end=end)
29+
frontier = a_star.a_star_search(graph = maze, start=start, end=end)
3030
solution = list(backtrack(frontier.visited,start,end))
3131
self.assertTrue( solution == my_solution )
3232

@@ -42,7 +42,7 @@ def test_2(self):
4242
end = (3,1)
4343

4444
# Call the A* algorithm and get the frontier
45-
frontier = a_star.a_star(graph = maze, start=start, end=end)
45+
frontier = a_star.a_star_search(graph = maze, start=start, end=end)
4646
maze.draw(width=3, point_to = frontier.visited, start=start, goal=end)
4747
maze.draw(width=3, number = frontier.costs, start=start, goal=end)
4848
print(frontier.visited)

0 commit comments

Comments
 (0)