Exemplo n.º 1
0
def test_get_neighbors_for_current_node(map_40):
    planner = PathPlanner(map_40, 5, 34)
    planner.openSet = {32, 16, 14}
    planner.fScore = {32: 10, 16: 5, 14: 7}
    expected_neighbors = [5, 14, 37, 30]
    current_node = planner.get_current_node()
    neighbors = planner.get_neighbors(current_node)
    assert expected_neighbors == neighbors
Exemplo n.º 2
0
def test_get_current_node(map_40):
    planner = PathPlanner(map_40, 14, 14)
    lowest_value = 3
    planner.openSet = {5, 1, lowest_value}
    planner.fScore = {1: 30, 2: 5, 3: 25, 5: 44}
    assert planner.get_current_node() == lowest_value