def main(domain, problem, useheuristic): t0 = time.time() (path, cost, visited_cnt, expanded_cnt) = plan(pddl.parse_domain(domain), pddl.parse_problem(problem), useheuristic) print("visited nodes:", visited_cnt, "expanded nodes:", expanded_cnt) if path is not None: print("Plan found with cost", cost) for n in path: print(n.name) else: print("No plan found") print("needed %.2f seconds" % (time.time() - t0))
def runplanner(domain, problem, useheuristic, cost, visited, expanded): (_, cost.value, visited.value, expanded.value) = planner.plan(pddl.parse_domain(domain), pddl.parse_problem(problem), useheuristic)