示例#1
0
    if javaFlag:
        faultMatrix = "input/{}_{}/fault_matrix.txt".format(prog, v)
    else:
        faultMatrix = "input/{}_{}/fault_matrix_key_tc.pickle".format(prog, v)

    outpath = "outputBudget-{}/{}_{}/".format(covType, prog, v)
    sPath = outpath + "selections/"
    tPath = outpath + "measures/"

    numOfTCS = sum((1 for _ in open(inputFile)))

    for reduction in range(1, 30 + 1):
        B = int(numOfTCS * reduction / 100)

        for run in range(repeats):
            pTime, rTime, sel = fastr.fastPlusPlus(inputFile, dim=dim, B=B)
            fdl = metric.fdl(sel, faultMatrix, javaFlag)
            sOut = "{}/{}-{}-{}.pickle".format(sPath, "FAST++", reduction,
                                               run + 1)
            pickle.dump(sel, open(sOut, "wb"))
            tOut = "{}/{}-{}-{}.pickle".format(tPath, "FAST++", reduction,
                                               run + 1)
            pickle.dump((pTime, rTime, fdl), open(tOut, "wb"))
            print("FAST++", reduction, pTime, rTime, fdl)

        for run in range(repeats):
            pTime, rTime, sel = fastr.fastCS(inputFile, dim=dim, B=B)
            fdl = metric.fdl(sel, faultMatrix, javaFlag)
            sOut = "{}/{}-{}-{}.pickle".format(sPath, "FAST-CS", reduction,
                                               run + 1)
            pickle.dump(sel, open(sOut, "wb"))
示例#2
0
    def one_(x):
        return 1

    inputFile = "input/scalability/scalability-bbox.txt"

    outpath = "outputLargeScale/"
    sPath = outpath + "selections/"
    tPath = outpath + "measures/"

    numOfTCS = sum((1 for _ in open(inputFile)))

    if alg == "FAST++":
        for reduction in range(repetitions):
            B = int(numOfTCS * reduction / 100)
            pTime, rTime, sel = fastr.fastPlusPlus(inputFile,
                                                   dim=dim,
                                                   B=B,
                                                   memory=False)
            sOut = "{}/{}-{}.pickle".format(sPath, "FAST++", reduction + 1)
            pickle.dump(sel, open(sOut, "wb"))
            tOut = "{}/{}-{}.pickle".format(tPath, "FAST++", reduction + 1)
            pickle.dump((pTime, rTime), open(tOut, "wb"))
            print("FAST++", reduction + 1, pTime, rTime)

    if alg == "FAST-CS":
        for reduction in range(repetitions):
            B = int(numOfTCS * reduction / 100)
            pTime, rTime, sel = fastr.fastCS(inputFile,
                                             dim=dim,
                                             B=B,
                                             memory=False)
            sOut = "{}/{}-{}.pickle".format(sPath, "FAST-CS", reduction + 1)