def calculate_total_combinations(self): self.total_combinations = 1 for workSetWithQuantity in self.workSetsWithQuantities: workSet = workSetWithQuantity[0] quantity = workSetWithQuantity[1] n_combinations_for_workSet = afc.combineNbyC(len(workSet), quantity) self.total_combinations *= n_combinations_for_workSet return self.total_combinations
def get_total_combinations(self): ''' total_combinations is a combination n by c, the same that is known by n!((n-c)!c!) where n is workSet's size and c is IndicesCombiner's quantity ''' if self.total_combinations != None: return self.total_combinations n = len(self.workSet) c = self.indicesCombiner.size self.total_combinations = afc.combineNbyC(n, c) return self.total_combinations