Skip to content

Commit

Permalink
Merge pull request #78 from APLA-Toolbox/fix-tests
Browse files Browse the repository at this point in the history
Fix pddl path in test
  • Loading branch information
guilyx authored Dec 29, 2020
2 parents 4ef0234 + e754ad1 commit 9383ef3
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -134,3 +134,4 @@ logs/*
!logs/.gitkeep
data.json
pddl-examples/*
data/*
6 changes: 4 additions & 2 deletions tests/test_search.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,29 +8,31 @@
import coloredlogs
import sys

apla = AutomatedPlanner("data/domain.pddl", "data/problem.pddl")


def test_searchDFS():
apla = AutomatedPlanner("pddl-examples/dinner/domain.pddl", "pddl-examples/dinner/problem.pddl")
dfs = DepthFirstSearch(apla)
res = dfs.search()
assert res[1] != 0 # Path, computation time, opened nodes


def test_searchBFS():
apla = AutomatedPlanner("pddl-examples/flip/domain.pddl", "pddl-examples/flip/problem.pddl")
bfs = BreadthFirstSearch(apla)
res = bfs.search() # Path, computation time, opened nodes
assert res[1] != 0


def test_searchDijkstra():
apla = AutomatedPlanner("pddl-examples/dinner/domain.pddl", "pddl-examples/dinner/problem.pddl")
dijk = DijkstraBestFirstSearch(apla)
res = dijk.search() # Goal, computation_time, opened_nodes(in this order)
assert res[1] != 0 # Assert that it took some time to compute
assert res[-1] > 0 # Assert that it visited some nodes


def test_searchAStar():
apla = AutomatedPlanner("pddl-examples/dinner/domain.pddl", "pddl-examples/dinner/problem.pddl")
astar = AStarBestFirstSearch(apla, apla.available_heuristics["goal_count"])
res = astar.search() # Goal, computation_time, opened_nodes(in this order)
assert res[1] != 0 # Assert that it took time to compute
Expand Down

0 comments on commit 9383ef3

Please sign in to comment.