class RateAnalyser(WinAnalyser): def __init__(self): super(RateAnalyser, self).__init__() self.timeAndGold = AnalysisTree(2, WinAnalyser, {1: anyValueTime, 2: anyValueGold}) def analyze(self, data): WinAnalyser.analyze(self, data) timeStep = getTimeSection(data.timeStamp) goldDiff = getGoldSection(data.goldDiff) self.timeAndGold.analyze((goldDiff, timeStep), data) def result(self): timeAndGoldTable = [self.timeAndGold.result(keys) for keys in product(possibleGoldValues, possibleTimeValues)] timeTable = [self.timeAndGold.result(keys) for keys in product((anyValueGold,), possibleTimeValues)] goldTable = [self.timeAndGold.result(keys) for keys in product(possibleGoldValues, (anyValueTime,))] winStatistic = self.timeAndGold.result((anyValueGold, anyValueTime)) return TimeGoldSpread(timeAndGoldTable, timeTable, goldTable, winStatistic)
if __name__ == '__main__': dataSets = generateDataSetsFromFiles() #keyGeneratorList = (regions, versions, Maps.idToMap, queueTypes, eloTypes, Champions.idToChampion, Items.apItemIds, roleTypes, laneTypes) #region patch map queue champion item role lane anyValues = { 1: LaneTypes.ANY, 2: RoleTypes.ANY, 3: 'ANY', 4: 'ANY', 5: EloType.ANY, 6: QueueType.ANY, 7: 'ANY', 8: Versions.ANY, 9: RegionTypes.ANY } analysisTree = AnalysisTree(9, RateAnalyser, anyValues) skipCounter = SavedObject(0, "../data/analysis/analysisCounter.pkl") print("Starting to analyze the data") doneCount = 0 oneRuncount = 0 def groupResultsChampItem(resultGen): comp = next(resultGen) partial = [comp] for result in resultGen: if not comp[0][4] == result[0][4]: commonKey = ShortKeyTuple(*comp[0][0:5]) yield GroupedResults(commonKey, partial)
def __init__(self): super(RateAnalyser, self).__init__() self.timeAndGold = AnalysisTree(2, WinAnalyser, {1: anyValueTime, 2: anyValueGold})