implment collection of historical data

This commit is contained in:
Yannik Schmidt
2020-09-27 10:38:35 +02:00
parent dd598fb06a
commit ecb6fa4152
4 changed files with 47 additions and 7 deletions

View File

@@ -106,10 +106,13 @@ def predictOutcome(teamA, teamB):
else:
raise ValueError("Probability was NAN, team rating must have been malformed.")
def balance(players, buddies=None):
def balance(players):
sortedByRating = sorted(players, key=lambda p: env.expose(p.rating))
teamA = []
teamB = []
graphs = db.getBuddyGraphs(players)
for i in range(0, len(players)):
if i % 2 == 0:
teamA += [sortedByRating[i]]