def write(self): wrCnt = random.randint(self.minNumWr, self.maxNumWr) self.tests.append(wrCnt) times = util.randMakeOne(wrCnt) i = 0 while i < wrCnt: idx = random.randint(0, len(self.peers)-1) self.peers[idx].write(self.graph, times[i]) i+=1
def makeConnections(self, list, maxC, minC): con = random.randint(minC, maxC) listIdx = [] x = 0 while x < con: listIdx.append(randintuni(listIdx,0, len(list)-1)) x+=1 for x in listIdx: self.next.append(list[x]) self._proNext = randMakeOne(len(self.next)) random.shuffle(self._proNext)