示例#1
0
文件: chord.py 项目: gaurav1710/Chord
    for i in range(1, n):
            #choose a random starting node from the list of existing nodes
            nodes[i].depart()

    if property.SIM:
        print "Printing Experiment Results..."
        print "\n\n**********************OBSERVATIONS***********************"
        print "INPUT PARAMETERS:"
        print "NUMBER OF NODES, N="+str(n)
        print "NUMBER OF BITS USED IN NODEID/KEY HASHES, M="+str(M)

        print "\nSTATS:"
        Stats().print_stats()

    #print_ring(head)
    data_collector.collect(n)
    Stats().reset()
    n += property.N

################################################## FAULT INTRODUCTION AND SIMULATION ##################################################

#1. Simulate a lookup just after deletion of few nodes

nodeIdGenerator.flush()
nodes = []
# Max number of bits = M
M = int(math.log(n, 2)) + 1

#Add first node
maxId = nodeIdGenerator.generate()
head = Node(maxId, M)
示例#2
0
文件: chord.py 项目: gaurav1710/Chord
    for i in range(1, n):
        #choose a random starting node from the list of existing nodes
        nodes[i].depart()

    if property.SIM:
        print "Printing Experiment Results..."
        print "\n\n**********************OBSERVATIONS***********************"
        print "INPUT PARAMETERS:"
        print "NUMBER OF NODES, N=" + str(n)
        print "NUMBER OF BITS USED IN NODEID/KEY HASHES, M=" + str(M)

        print "\nSTATS:"
        Stats().print_stats()

    #print_ring(head)
    data_collector.collect(n)
    Stats().reset()
    n += property.N

################################################## FAULT INTRODUCTION AND SIMULATION ##################################################

#1. Simulate a lookup just after deletion of few nodes

nodeIdGenerator.flush()
nodes = []
# Max number of bits = M
M = int(math.log(n, 2)) + 1

#Add first node
maxId = nodeIdGenerator.generate()
head = Node(maxId, M)