Exemple #1
0
    #       ["DUCT", "frodo2.algorithms.duct.DUCTsolver", "../agents/DUCT/DUCTagent.xml", problemFile],
    #
    #         ["DSA", "frodo2.algorithms.localSearch.dsa.DSAsolver", "../agents/DSA/DSAagent.xml", problemFile],
    #
    #         ["MaxSum", "frodo2.algorithms.maxsum.MaxSumSolver", "../agents/MaxSum/MaxSumAgent.xml", problemFile],
    #
    #         ["MGM", "frodo2.algorithms.localSearch.mgm.MGMsolver", "../agents/MGM/MGMagent.xml", problemFile],
    #         ["MGM2", "frodo2.algorithms.localSearch.mgm.mgm2.MGM2solver", "../agents/MGM/MGM2agent.xml", problemFile],
    [
        "SynchBB", "frodo2.algorithms.synchbb.SynchBBsolver",
        "../agents/SynchBB/SynchBBagent.xml", problemFile
    ],
]
timeout = 120  # in seconds

# The CSV file to which the statistics should be written
output = "outputMaxDisCSP.csv"

# Run the experiment
frodo2.run(java, javaParams, generator, genParams, nbrProblems, algos, timeout,
           output)

# Tip: if some of the algorithms tend to time out most of the time on some problem files,
# you can run 2 experiments: one for all algorithms on the smaller problem sizes,
# and one with only the faster algorithms on the larger problem sizes

# Plot the graphs
frodo2.plot(
    output, xCol=8,
    yCol=11)  # yCol = 11 is the NCCC count (the first column has index 0)
# 		["MB-DPOP", "frodo2.algorithms.dpop.DPOPsolver", "../agents/DPOP/MB-DPOP/MB-DPOPagentJaCoP.xml", problemFile], 
#  		["O-DPOP", "frodo2.algorithms.odpop.ODPOPsolver", "../agents/DPOP/O-DPOP/O-DPOPagentJaCoP.xml", problemFile], 
		["P-DPOP", "frodo2.algorithms.dpop.privacy.P_DPOPsolver", "../agents/DPOP/P-DPOP/P-DPOPagentJaCoP.xml", problemFile], 
		["P2-DPOP", "frodo2.algorithms.dpop.privacy.P2_DPOPsolver", "../agents/DPOP/P-DPOP/P2-DPOPagentJaCoP_DisCSP.xml", problemFile], 
# 
# 		["DSA", "frodo2.algorithms.localSearch.dsa.DSAsolver", "../agents/DSA/DSAagentJaCoP.xml", problemFile], 
# 
# 		["MaxSum", "frodo2.algorithms.maxsum.MaxSumSolver", "../agents/MaxSum/MaxSumAgentJaCoP.xml", problemFile], 
# 
# 		["MGM", "frodo2.algorithms.localSearch.mgm.MGMsolver", "../agents/MGM/MGMagentJaCoP.xml", problemFile], 
# 		["MGM2", "frodo2.algorithms.localSearch.mgm.mgm2.MGM2solver", "../agents/MGM/MGM2agentJaCoP.xml", problemFile], 
# 
		["MPC-DisCSP4", "frodo2.algorithms.mpc_discsp.MPC_DisWCSP4solver", "../agents/MPC/MPC-DisCSP4_JaCoP.xml", problemFileMPC], 

# 		["SynchBB", "frodo2.algorithms.synchbb.SynchBBsolver", "../agents/SynchBB/SynchBBagentJaCoP.xml", problemFile], 
		]
timeout = 600 # in seconds

# The CSV file to which the statistics should be written
output = "outputParty.csv"

# Run the experiment
frodo2.run(java, javaParams, generator, genParams, nbrProblems, algos, timeout, output)

# Tip: if some of the algorithms tend to time out most of the time on some problem files, 
# you can run 2 experiments: one for all algorithms on the smaller problem sizes, 
# and one with only the faster algorithms on the larger problem sizes

# Plot the graphs
frodo2.plot(output, xCol = 6, yCol = 10) # the first column has index 0
Exemple #3
0
# Run each experiment nbrProblems times
outputs = [] # the names of the CSV output files
for i in range(0, nbrProblems):
    print("\n" + str(i + 1) + "/" + str(nbrProblems))
    
    # Run each experiment
    for exp in experiments: 
        print("\n" + exp[0]) # prints the algorithm
        
        # The CSV file to which the statistics should be written
        output = exp[0] + ".csv"
        outputs += [output]
        
        # Run the experiment
        frodo2.run(java, javaParamsNew, generator, exp[1], 1, exp[2], timeout, output, saveProblems = False)

# Plot the results for each experiment
for j in range(0, len(experiments)): 
    exp = experiments[j]

    # The CSV file to which the statistics should have been written
    output = outputs[j]

    # Plot curves with x = problem size and y = performance of each algorithm
#     frodo2.plot(output, xCol = 9, yCol = 15, block = False) # 15 = message size
#     frodo2.plot(output, xCol = 9, yCol = 13, block = (j == len(experiments)-1)) # 13 = runtime

    # Scatter plot with one data point per instance, x = old algorithm and y = new algorithm
    xAlgo = exp[2][0][0]
    yAlgo = exp[2][1][0]
# Run each experiment nbrProblems times
outputs = []  # the names of the CSV output files
for i in range(0, nbrProblems):
    print("\n" + str(i + 1) + "/" + str(nbrProblems))

    # Run each experiment
    for exp in experiments:
        print("\n" + exp[0])  # prints the algorithm

        # The CSV file to which the statistics should be written
        output = exp[0] + ".csv"
        outputs += [output]

        # Run the experiment
        frodo2.run(java, javaParamsNew, generator, exp[1], 1, exp[2], timeout,
                   output)

# Plot the results for each experiment
for j in range(0, len(experiments)):
    exp = experiments[j]

    # The CSV file to which the statistics should have been written
    output = outputs[j]

    # Plot curves with x = problem size and y = performance of each algorithm
    #     frodo2.plot(output, xCol = 6, yCol = 15, block = False) # 15 = message size
    #     frodo2.plot(output, xCol = 6, yCol = 13, block = (j == len(experiments)-1)) # 13 = runtime

    # Scatter plot with one data point per instance, x = old algorithm and y = new algorithm
    xAlgo = exp[2][0][0]
    yAlgo = exp[2][1][0]