File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ from jupyddl .heuristics import goal_count_heuristic , zero_heuristic
12from jupyddl .automated_planner import AutomatedPlanner
23from jupyddl .dijkstra import DijkstraBestFirstSearch
34from jupyddl .a_star import AStarBestFirstSearch
78import coloredlogs
89import sys
910
11+ apla = AutomatedPlanner ("data/domain.pddl" , "data/problem.pddl" )
12+
1013def test_searchDFS ():
11- apla = AutomatedPlanner ("data/domain.pddl" , "data/problem.pddl" )
1214 dfs = DepthFirstSearch (apla )
1315 _ ,ct = dfs .search ()
1416 assert ct != 0
1517
1618def test_searchBFS ():
17- apla = AutomatedPlanner ("data/domain.pddl" , "data/problem.pddl" )
1819 bfs = BreadthFirstSearch (apla )
1920 _ ,ct = bfs .search ()
2021 assert ct != 0
22+
23+ def test_searchDijkstra ():
24+ dijk = DijkstraBestFirstSearch (apla )
25+ res = dijk .search () # None, computation_time, opened_nodes(in this order)
26+ assert (res [1 ] != 0 )
27+ assert (res [- 1 ] >= 1 )
28+
29+ def test_searchAStar ():
30+ astar = AStarBestFirstSearch (apla , goal_count_heuristic )
31+ res = astar .search () # None, computation_time, opened_nodes(in this order)
32+ assert (res [1 ] != 0 )
33+ assert (res [- 1 ] >= 1 )
You can’t perform that action at this time.
0 commit comments