def solve_sequential(evaluations, goal_exp, domain, unit_costs=False, debug=False, **search_args): problem = get_problem(evaluations, goal_exp, domain, unit_costs) task = task_from_domain_problem(domain, problem) if has_attachments(domain): with Verbose(debug): instantiated = instantiate_task(task) return solve_pyplanners(instantiated, **search_args) sas_task = sas_from_pddl(task, debug=debug) return abstrips_solve_from_task(sas_task, debug=debug, **search_args)
def solve_finite(evaluations, goal_exp, domain, unit_costs=False, debug=False, **search_args): if isinstance(domain, SimplifiedDomain): problem = get_problem_pddl(evaluations, goal_exp, domain.pddl) pddl_plan, cost = solve_tfd(domain.pddl, problem, debug=debug) else: problem = get_problem(evaluations, goal_exp, domain, unit_costs) task = task_from_domain_problem(domain, problem) if has_attachments(domain): with Verbose(debug): instantiated = instantiate_task(task) pddl_plan, cost = solve_pyplanners(instantiated, **search_args) else: sas_task = sas_from_pddl(task, debug=debug) pddl_plan, cost = abstrips_solve_from_task(sas_task, debug=debug, **search_args) plan = obj_from_pddl_plan(pddl_plan) return plan, cost