Esempio n. 1
0
def launch_french_fusion():
    structure = read_directory("Data/frenchapproval")
    functions = [dissimilarity_and_n, dissimilarity_and_or, dissimilarity_over_over]
    names = ["dissimilarity\_and\_n weighted", "dissimilarity\_and\_n not weighted",
             "dissimilarity\_and\_or weighted", "dissimilarity\_and\_or not weighted",
             "dissimilarity\_over\_over weighted", "dissimilarity\_over\_over not weighted"]
    s = ""
    for i in range(6):
        print "Iteration " + str(i)
        s += axes_to_latex_graph(structure, listFrenchAxes[0], names[i], functions[i/2], i % 2 == 0,
                                 unwanted_candidates=[2, 3, 7, 11])
    fp = open("Data/TeX/french_fusion.tex", "w")
    fp.write(s)
    fp.close()
Esempio n. 2
0
def example_all_files():
    structure = read_directory(sys.argv[1])
    preferences = structure["preferences"]
    candidates = [i+1 for i in range(len(structure["candidates"]))]
    print("Preferences : " + str(preferences))
    print("Candidats : " + str(candidates))
    t1 = time()
    bb, best = bnb(len(preferences), preferences, candidates)
    t2 = time()
    print("done")
    f = sys.argv[1].split(".")[0]  + "_resultat.txt"
    wfile = open(f, 'w')
    wfile.write("Plus large ensemble cohérent : ")
    for bull in best[0][0]:
        wfile.write(str(bull) + "\n")
    wfile.write("Resultat : " + str(best[1]) + "\n")
    wfile.write("Duration : " + str(t2-t1) + "\n")
    wfile.write("Axes :\n")
    axes, card = find_axes2(best[0][0], candidates)
    if axes:
        for a in axes:
            wfile.write(str(a)+"\n")
    wfile.close()
Esempio n. 3
0
def launch_french_fusion():
    structure = read_directory("Data/frenchapproval")
    functions = [
        dissimilarity_and_n, dissimilarity_and_or, dissimilarity_over_over
    ]
    names = [
        "dissimilarity\_and\_n weighted", "dissimilarity\_and\_n not weighted",
        "dissimilarity\_and\_or weighted",
        "dissimilarity\_and\_or not weighted",
        "dissimilarity\_over\_over weighted",
        "dissimilarity\_over\_over not weighted"
    ]
    s = ""
    for i in range(6):
        print "Iteration " + str(i)
        s += axes_to_latex_graph(structure,
                                 listFrenchAxes[0],
                                 names[i],
                                 functions[i / 2],
                                 i % 2 == 0,
                                 unwanted_candidates=[2, 3, 7, 11])
    fp = open("Data/TeX/french_fusion.tex", "w")
    fp.write(s)
    fp.close()