コード例 #1
0
def specific_example_gen():
    set_timeout(120)
    specific_file_names = [
        "./examples/amba_decomposed_tincr.tlsf.gpg",
        "./examples/load_balancer_2.tlsf.gpg"
    ]

    def specific_generator(i):
        game = file_handler.load_generalized_from_file(specific_file_names[i])
        game.name = specific_file_names[i][11:]
        return game

    labels = ["psolB", "psolQ", "psolC"]
    algorithms_general = [
        psolB_generalized.psolB_generalized_inline,
        psolQ_generalized.psolQ_generalized,
        psolC_generalized.psolC_generalized
    ]

    compare_partial_algorithms(
        algorithms_general,
        specific_generator,
        2,
        preprocess=[None, None, None, None, None],
        iterations=4,
        step=1,
        labels=labels,
        plot=True,
        path_time="allgen_time.pdf",
        path_proportion="allgen_prop.pdf",
        path_bulkprop="allgen_bulkprop.pdf",
        path_tottime="allgen_tottime.pdf",
        # control_algorithm=gpg.generalized_parity_solver,
        pkl_path="allgen_data.pkl")

    algorithms_partial_genzielonka =\
        [gpg.generalized_parity_solver,
         genpartial.generalized_with_psolB,
         genpartial.generalized_zielonka_with_psolQ,
         genpartial.generalized_zielonka_with_psolC]

    labels_partial_genzielonka = [
        "Gen Zielonka", "Gen Ziel + Gen psolB", "Gen Ziel + Gen psolQ",
        "Gen Ziel + Gen psolC"
    ]

    compare_complete_algorithms_LTLbenchmarks(
        algorithms_partial_genzielonka,
        specific_generator,
        2,
        preprocess=[None] * len(labels_partial_genzielonka),
        iterations=4,
        step=1,
        check_solution=False,
        plot=True,
        path="genziel+partials-time.pdf",
        path_tot="genziel+partials-cumulative.pdf",
        title="Comparison of Gen Zielonka + partial solver on LTL benchmarks",
        pkl_path="genziel_combo.pkl",
        labels=labels_partial_genzielonka)
コード例 #2
0
def partial_gen():
    # generalized parity games now
    labels = ["psolB", "psolQ", "psolC"]
    algorithms_general = [
        psolB_generalized.psolB_generalized_inline,
        psolQ_generalized.psolQ_generalized,
        psolC_generalized.psolC_generalized
    ]

    print("experiments for generalized parity games: all files in ./examples")

    compare_partial_algorithms(
        algorithms_general,
        all_generalized_examples,
        num_gen_examples,
        preprocess=[None, None, None, None, None],
        iterations=2,
        step=1,
        labels=labels,
        plot=True,
        path_time="allgen_time.pdf",
        path_proportion="allgen_prop.pdf",
        path_bulkprop="allgen_bulkprop.pdf",
        path_tottime="allgen_tottime.pdf",
        # control_algorithm=gpg.generalized_parity_solver,
        pkl_path="allgen_data.pkl")
コード例 #3
0
def specific_example():
    set_timeout(120)
    specific_file_name = "./examples/ltl2dba_E_10.tlsf.pg"

    def specific_generator(i):
        game = file_handler.load_from_file(specific_file_name)
        game.name = specific_file_name[10:]
        return game

    # first, the complete algorithms for one dimension

    algorithms_partial_zielonka_specific =\
        [zielonka.strong_parity_solver_no_strategies,
         zielonka.zielonka_with_psolB,
         zielonka.zielonka_with_psolQ,
         zielonka.zielonka_with_psolC]

    labels_partial_zielonka_specific = [
        "Zielonka", "Ziel + psolB", "Ziel + psolQ", "Ziel + psolC"
    ]

    compare_complete_algorithms_LTLbenchmarks(
        algorithms_partial_zielonka_specific,
        specific_generator,
        1,
        preprocess=[None] * len(labels_partial_zielonka_specific),
        iterations=4,
        step=1,
        check_solution=False,
        plot=True,
        path="all_ziel.pdf",
        path_tot="all_ziel_cumulative.pdf",
        title="Comparison of Zielonka + partial solver on LTL benchmarks",
        pkl_path="ziel_combo.pkl",
        labels=labels_partial_zielonka_specific)

    # then only the partials for one dimension

    labels_partial_specific = ["psolB", "psolQ", "psolC"]
    algorithms_partial_specific = [psolB.psolB_set, psolQ.psolQ, psolC.psolC]

    compare_partial_algorithms(
        algorithms_partial_specific,
        specific_generator,
        1,
        preprocess=[None] * len(labels_partial_specific),
        iterations=4,
        step=1,
        labels=labels_partial_specific,
        plot=True,
        path_time="all_time.pdf",
        path_proportion="all_prop.pdf",
        path_bulkprop="all_bulkprop.pdf",
        path_tottime="all_tottime.pdf",
        # control_algorithm=zielonka.strong_parity_solver_no_strategies,
        pkl_path="all_data.pkl")
コード例 #4
0
def partial():
    labels = ["psolB", "psolQ", "psolC"]
    algorithms_partial = [psolB.psolB_set, psolQ.psolQ, psolC.psolC]

    print("Running experiments for all files in ./examples")

    compare_partial_algorithms(
        algorithms_partial,
        all_examples,
        num_examples,
        preprocess=[None, None, None, None, None],
        iterations=2,
        step=1,
        labels=labels,
        plot=True,
        path_time="all_time.pdf",
        path_proportion="all_prop.pdf",
        path_bulkprop="all_bulkprop.pdf",
        path_tottime="all_tottime.pdf",
        # control_algorithm=zielonka.strong_parity_solver_no_strategies,
        pkl_path="all_data.pkl")
コード例 #5
0
def fatal_abo():
    set_timeout(1500)

    labels = ["psolB", "psolQ", "psolC"]
    algorithms_partial = [psolB.psolB_set, psolQ.psolQ, psolC.psolC]

    print("Running experiments for PGSolver hard examples")

    compare_partial_algorithms(
        algorithms_partial,
        abo_examples,
        num_abo_examples,
        preprocess=[None, None, None, None, None],
        iterations=1,
        step=1,
        labels=labels,
        plot=True,
        path_time="abo_time.pdf",
        path_proportion="abo_prop.pdf",
        path_bulkprop="abo_bulkprop.pdf",
        path_tottime="abo_tottime.pdf",
        # control_algorithm=zielonka.strong_parity_solver_no_strategies,
        pkl_path="abo_part.pkl")