Exemplo n.º 1
0
          "lazy_greedy(h,preferred=(h),cost_type=S_COST_TYPE,bound=BOUND)"]),
    # lazy_greedy_add
    (63, ["--heuristic", "h=add(cost_type=H_COST_TYPE)",
          "--search",
          "lazy_greedy(h,preferred=(h),cost_type=S_COST_TYPE,bound=BOUND)"]),
     ]

def build_final_config(successful_args):
# this heavily depends on that in CONFIGS only "simple" configurations are used
    new_args = list(successful_args)
    for pos, arg in enumerate(successful_args):
        if arg == "--search":
            orig_search = successful_args[pos + 1]
            sub_searches = []
            for weight in (5,3,2,1):
                if orig_search.startswith("lazy"):
                    sub_search = \
                        "lazy_wastar(h,preferred=(h),w=%d,cost_type=S_COST_TYPE)" % weight
                else:
                    sub_search = \
                        "eager(single(sum(g(),weight(h,%d))),preferred=(h),cost_type=S_COST_TYPE)" % weight
                sub_searches.append(sub_search)
            sub_search_string = ",".join(sub_searches)
            new_search = "iterated(%s,bound=BOUND,repeat_last=true,plan_counter=PLANCOUNTER)" % sub_search_string
            new_args[pos + 1] = new_search
            break
    return new_args

seq_sat_portfolio.run(configs=CONFIGS,
                      final_config_builder=build_final_config)
Exemplo n.º 2
0
          "lazy_wastar(h,w=3,preferred=(h),cost_type=S_COST_TYPE,bound=BOUND)"]),
    # eager_greedy_cea_1
    (84, ["--heuristic", "h=cea(cost_type=H_COST_TYPE)",
          "--search",
          "eager_greedy(h,preferred=(h),cost_type=S_COST_TYPE,bound=BOUND)"]),
    # eager_wa3_add_1
    (166, ["--heuristic", "h=add(cost_type=H_COST_TYPE)",
          "--search",
          "eager(single(sum(g(),weight(h,3))),preferred=(h),cost_type=S_COST_TYPE,bound=BOUND)"]),
    # eager_wa3_ff_1
    (87, ["--heuristic", "h=ff(cost_type=H_COST_TYPE)",
          "--search",
          "eager(single(sum(g(),weight(h,3))),preferred=(h),cost_type=S_COST_TYPE,bound=BOUND)"]),
    # lazy_wa3_cg_1
    (73, ["--heuristic", "h=cg(cost_type=H_COST_TYPE)",
         "--search",
         "lazy_wastar(h,w=3,preferred=(h),cost_type=S_COST_TYPE,bound=BOUND)"]),
    # eager_wa3_cg_1
    (89, ["--heuristic", "h=cg(cost_type=H_COST_TYPE)",
          "--search",
          "eager(single(sum(g(),weight(h,3))),preferred=(h),cost_type=S_COST_TYPE,bound=BOUND)"]),
     ]

FINAL_CONFIG = [
    "--heuristic", "h=ff(cost_type=H_COST_TYPE)",
    "--search",
    "iterated(eager(single(sum(g(),weight(h,3))),preferred=(h),cost_type=S_COST_TYPE,bound=BOUND),bound=BOUND,repeat_last=true,plan_counter=PLANCOUNTER)"]

seq_sat_portfolio.run(configs=CONFIGS,
                      final_config=FINAL_CONFIG, timeout=1800) # TODO: set timeout to 1800
Exemplo n.º 3
0
    (63, [
        "--heuristic", "h=add(cost_type=H_COST_TYPE)", "--search",
        "lazy_greedy(h,preferred=(h),cost_type=S_COST_TYPE,bound=BOUND)"
    ]),
]


def build_final_config(successful_args):
    # this heavily depends on that in CONFIGS only "simple" configurations are used
    new_args = list(successful_args)
    for pos, arg in enumerate(successful_args):
        if arg == "--search":
            orig_search = successful_args[pos + 1]
            sub_searches = []
            for weight in (5, 3, 2, 1):
                if orig_search.startswith("lazy"):
                    sub_search = \
                        "lazy_wastar(h,preferred=(h),w=%d,cost_type=S_COST_TYPE)" % weight
                else:
                    sub_search = \
                        "eager(single(sum(g(),weight(h,%d))),preferred=(h),cost_type=S_COST_TYPE)" % weight
                sub_searches.append(sub_search)
            sub_search_string = ",".join(sub_searches)
            new_search = "iterated(%s,bound=BOUND,repeat_last=true,plan_counter=PLANCOUNTER)" % sub_search_string
            new_args[pos + 1] = new_search
            break
    return new_args


seq_sat_portfolio.run(configs=CONFIGS, final_config_builder=build_final_config)