Skip to content

Commit a16e74a

Browse files
committed
fix: docstring
1 parent 560ae40 commit a16e74a

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

Diff for: graphs/greedy_best_first.py

+4-3
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,8 @@ def __eq__(self, other):
8989

9090
class GreedyBestFirst:
9191
"""
92-
>>> gbf = GreedyBestFirst((0, 0), (len(grid) - 1, len(grid[0]) - 1))
92+
>>> grid = [[0, 0, 1, 0, 0], [0, 1, 0, 0, 0], [0, 0, 1, 0, 1], [1, 0, 0, 1, 1], [0, 0, 0, 0, 0]]
93+
>>> gbf = GreedyBestFirst(grid, (0, 0), (len(grid) - 1, len(grid[0]) - 1))
9394
>>> [x.pos for x in gbf.get_successors(gbf.start)]
9495
[(1, 0), (0, 1)]
9596
>>> (gbf.start.pos_y + delta[3][0], gbf.start.pos_x + delta[3][1])
@@ -99,8 +100,8 @@ class GreedyBestFirst:
99100
>>> gbf.retrace_path(gbf.start)
100101
[(0, 0)]
101102
>>> gbf.search() # doctest: +NORMALIZE_WHITESPACE
102-
[(0, 0), (1, 0), (2, 0), (3, 0), (3, 1), (4, 1), (5, 1), (6, 1),
103-
(6, 2), (6, 3), (5, 3), (5, 4), (5, 5), (6, 5), (6, 6)]
103+
[(0, 0), (1, 0), (2, 0), (2, 1), (3, 1), (4, 1), (4, 2), (4, 3),
104+
(4, 4)]
104105
"""
105106

106107
def __init__(self, grid: list[list[int]], start: tuple[int, int], goal: tuple[int, int]):

0 commit comments

Comments
 (0)