|
10 | 10 |
|
11 | 11 |
|
12 | 12 | def test_searchDFS(): |
13 | | - apla = AutomatedPlanner("pddl-examples/dinner/domain.pddl", "pddl-examples/dinner/problem.pddl") |
| 13 | + apla = AutomatedPlanner( |
| 14 | + "pddl-examples/dinner/domain.pddl", "pddl-examples/dinner/problem.pddl" |
| 15 | + ) |
14 | 16 | dfs = DepthFirstSearch(apla) |
15 | 17 | res = dfs.search() |
16 | 18 | assert res[1] != 0 # Path, computation time, opened nodes |
17 | 19 |
|
18 | 20 |
|
19 | 21 | def test_searchBFS(): |
20 | | - apla = AutomatedPlanner("pddl-examples/flip/domain.pddl", "pddl-examples/flip/problem.pddl") |
| 22 | + apla = AutomatedPlanner( |
| 23 | + "pddl-examples/flip/domain.pddl", "pddl-examples/flip/problem.pddl" |
| 24 | + ) |
21 | 25 | bfs = BreadthFirstSearch(apla) |
22 | 26 | res = bfs.search() # Path, computation time, opened nodes |
23 | 27 | assert res[1] != 0 |
24 | 28 |
|
25 | 29 |
|
26 | 30 | def test_searchDijkstra(): |
27 | | - apla = AutomatedPlanner("pddl-examples/dinner/domain.pddl", "pddl-examples/dinner/problem.pddl") |
| 31 | + apla = AutomatedPlanner( |
| 32 | + "pddl-examples/dinner/domain.pddl", "pddl-examples/dinner/problem.pddl" |
| 33 | + ) |
28 | 34 | dijk = DijkstraBestFirstSearch(apla) |
29 | 35 | res = dijk.search() # Goal, computation_time, opened_nodes(in this order) |
30 | 36 | assert res[1] != 0 # Assert that it took some time to compute |
31 | 37 | assert res[-1] > 0 # Assert that it visited some nodes |
32 | 38 |
|
33 | 39 |
|
34 | 40 | def test_searchAStar(): |
35 | | - apla = AutomatedPlanner("pddl-examples/dinner/domain.pddl", "pddl-examples/dinner/problem.pddl") |
| 41 | + apla = AutomatedPlanner( |
| 42 | + "pddl-examples/dinner/domain.pddl", "pddl-examples/dinner/problem.pddl" |
| 43 | + ) |
36 | 44 | astar = AStarBestFirstSearch(apla, apla.available_heuristics["goal_count"]) |
37 | 45 | res = astar.search() # Goal, computation_time, opened_nodes(in this order) |
38 | 46 | assert res[1] != 0 # Assert that it took time to compute |
|
0 commit comments