@@ -57,3 +57,28 @@ def test_search_astar_delete_relaxation():
5757 res = astar .search () # Goal, computation_time, opened_nodes(in this order)
5858 assert res [1 ] != 0 # Assert that it took time to compute
5959 assert res [- 1 ] > 0 # Assert that it visited at least one node
60+
61+ def test_search_getter_costs ():
62+ apla = AutomatedPlanner (
63+ "pddl-examples/tsp/domain.pddl" , "pddl-examples/tsp/problem.pddl"
64+ )
65+ bfs = BreadthFirstSearch (apla )
66+ path , _ , _ = bfs .search () # Path, computation time, opened nodes
67+ plan = apla .get_actions_from_path (path )
68+ state_plan = apla .get_state_def_from_path (path )
69+
70+ assert path and plan and state_plan
71+
72+ def test_search_getter_no_costs ():
73+ apla = AutomatedPlanner (
74+ "pddl-examples/cargo/domain.pddl" , "pddl-examples/cargo/problem.pddl"
75+ )
76+ bfs = BreadthFirstSearch (apla )
77+ path , _ , _ = bfs .search () # Path, computation time, opened nodes
78+ plan = apla .get_actions_from_path (path )
79+ state_plan = apla .get_state_def_from_path (path )
80+
81+ assert path and plan and state_plan
82+
83+
84+
0 commit comments