diff --git a/planning.py b/planning.py index 4bfa1d71a..a17677460 100644 --- a/planning.py +++ b/planning.py @@ -405,8 +405,8 @@ def __init__(self, pdll, negkb): self.levels = [Level(pdll.kb, negkb)] self.objects = set(arg for clause in pdll.kb.clauses + negkb.clauses for arg in clause.args) - def __call__(): - expand_graph() + def __call__(self): + self.expand_graph() def expand_graph(self): last_level = self.levels[-1] diff --git a/tests/test_planning.py b/tests/test_planning.py index 3567ab445..4e012b207 100644 --- a/tests/test_planning.py +++ b/tests/test_planning.py @@ -69,3 +69,13 @@ def test_have_cake_and_eat_cake_too(): p.act(action) assert p.goal_test() + +def test_graph_call(): + pdll = spare_tire() + negkb = FolKB([expr('At(Flat, Trunk)')]) + graph = Graph(pdll, negkb) + + levels_size = len(graph.levels) + graph() + + assert levels_size == len(graph.levels) - 1