Exemple #1
0
 def __init__(self):
     AllCombinations.__init__(self) # ??? should this be AllFiles.__init__ ???
     self.caseList = []
     self.pairs = {}
     self.caseNumber = 1
     self.lists = []
     self.row = None
Exemple #2
0
 def __init__(self):
     AllCombinations.__init__(
         self)  # ??? should this be AllFiles.__init__ ???
     self.caseList = []
     self.pairs = {}
     self.caseNumber = 1
     self.lists = []
     self.row = None
Exemple #3
0
 def generate(self):
     numPairsWanted = len(self.lists) * (len(self.lists) - 1) / 2
     if numPairsWanted > 1:
         while numPairsWanted > 0 and len(self.caseList) > 0:
             i = 0
             while i < len(self.caseList):
                 numUngeneratedPairs = self.evaluateCase(self.caseList[i])
                 if numUngeneratedPairs == 0:
                     del self.caseList[i]
                 elif numUngeneratedPairs >= numPairsWanted:
                     self.addToPairTable(self.caseList[i])
                     AllCombinations.doCase(self, self.caseList[i])
                     del self.caseList[i]
                 else:
                     i += 1
             numPairsWanted -= 1
     else:
         for case in self.caseList:
             AllCombinations.doCase(self, case)
     self.summary["total pairs"] = "%s" % len(self.pairs)
Exemple #4
0
 def generate(self):
     numPairsWanted = len(self.lists) * (len(self.lists) - 1) / 2
     if numPairsWanted > 1:
         while numPairsWanted > 0 and len(self.caseList) > 0:
             i = 0
             while i < len(self.caseList):
                 numUngeneratedPairs = self.evaluateCase(self.caseList[i])
                 if numUngeneratedPairs == 0:
                     del self.caseList[i]
                 elif numUngeneratedPairs >= numPairsWanted:
                     self.addToPairTable(self.caseList[i])
                     AllCombinations.doCase(self, self.caseList[i])
                     del self.caseList[i]
                 else:
                     i += 1
             numPairsWanted -= 1
     else:
         for case in self.caseList:
             AllCombinations.doCase(self, case)
     self.summary["total pairs"] = "%s" % len(self.pairs)