Exemple #1
0
def main(focused=True, unit_costs=False):
    problem_fn = get_shift_one_problem  # get_shift_one_problem | get_shift_all_problem
    tamp_problem = problem_fn()
    print(tamp_problem)

    pddlstream_problem = pddlstream_from_tamp(tamp_problem)
    if focused:
        solution = solve_focused(pddlstream_problem, unit_costs=unit_costs)
    else:
        solution = solve_incremental(pddlstream_problem, unit_costs=unit_costs)
    print_solution(solution)
    plan, cost, evaluations = solution
    if plan is None:
        return
    apply_plan(tamp_problem, plan)
Exemple #2
0
def main():
    parser = create_parser()
    args = parser.parse_args()
    print('Arguments:', args)

    problem_fn = get_shift_one_problem  # get_shift_one_problem | get_shift_all_problem
    tamp_problem = problem_fn()
    print(tamp_problem)

    pddlstream_problem = pddlstream_from_tamp(tamp_problem)
    solution = solve(pddlstream_problem,
                     algorithm=args.algorithm,
                     unit_costs=args.unit)

    print_solution(solution)
    plan, cost, evaluations = solution
    if plan is None:
        return
    apply_plan(tamp_problem, plan)
Exemple #3
0
def main(focused=True, unit_costs=False):
    problem_fn = get_shift_one_problem # get_shift_one_problem | get_shift_all_problem
    tamp_problem = problem_fn()
    print(tamp_problem)

    stream_info = {
        # TODO: be careful when negate=False. Might produce a colliding solution
        'test-cfree': StreamInfo(negate=True),
    }
    pddlstream_problem = pddlstream_from_tamp(tamp_problem)
    if focused:
        solution = solve_focused(pddlstream_problem, stream_info=stream_info, unit_costs=unit_costs)
    else:
        solution = solve_incremental(pddlstream_problem, unit_costs=unit_costs)
    print_solution(solution)
    plan, cost, evaluations = solution
    if plan is None:
        return
    apply_plan(tamp_problem, plan)