Exemplo n.º 1
0
        f.write("sumLdivValues: " + str(self.sumLdivValues) + "\n")
        f.write("sumQueryCellSize: " + str(self.sumQueryCellSize) + "\n")
        f.write("sumOrgEmdValue: " + str(self.sumOrgEmdValue) + "\n")
        f.write("numNoLocTypes: " + str(self.numNoLocTypes) + "\n")
        print "self.numOfQuery : ", self.numOfQuery
        print "self.numNoLocTypes: ", self.numNoLocTypes
        f.write("avgOrgEmd: " + str(self.sumOrgEmdValue / (self.numOfQuery - self.numNoLocTypes)) + "\n")
        f.close()

        f = open(dumpFilename + "_orgEmdValues_%d.txt" % (self.l_threshold), "w")
        for emdValue, isFailed, cellSize in self.allOrgEmdValues:
            f.write("%lf %s %d\n" % (emdValue, (str(isFailed)), cellSize))
        f.close()
        return


#################################################################
if __name__ == "__main__":
    # logDir = "./log/rich/"
    # logDir = "./log/secret/"
    # logDir = "./log/rainbow/"
    logDir = option.getLogDir()

    l_threshold = 3

    if len(sys.argv) > 1:
        l_threshold = int(sys.argv[1])

    print "l_threshold: ", l_threshold
    ldiversity = Ldiversity(logDir=logDir, l_threshold=l_threshold)
Exemplo n.º 2
0
        f.write("sumKanomValues: " + str(self.sumKanomValues) + "\n")
        f.write("sumQueryCellSize: " + str(self.sumQueryCellSize) + "\n")
        f.write("sumOrgEmdValue: " + str(self.sumOrgEmdValue) + "\n")
        f.write("numFailed: " + str(self.numFailed) + "\n")
        f.write("avgOrgEmd: " + str(self.sumOrgEmdValue /
                                    (self.numOfQuery - self.numFailed)) + "\n")
        f.close()

        f = open(dumpFilename + "_orgEmdValues_%d.txt" % (self.k_threshold),
                 "w")
        for emdValue, isFailed, cellSize in self.allOrgEmdValues:
            f.write("%lf %s %d\n" % (emdValue, (str(isFailed)), cellSize))
        f.close()
        print "end of dumpResult()"
        return


#################################################################
if __name__ == "__main__":
    #logDir = "./log/jung/"
    #logDir = "./log/rainbow/"
    logDir = option.getLogDir()

    k_threshold = 3

    if len(sys.argv) > 1:
        k_threshold = int(sys.argv[1])

    print "k_threshold : ", k_threshold
    Kanonymity = Kanonymity(logDir=logDir, k_threshold=k_threshold)