-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmatchmaking.py
26 lines (16 loc) · 955 Bytes
/
matchmaking.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
from calculateElo import elo, expected
"""updateElo explained
losing_bots is an array of the names of the bots that lost.
winning_bots is an array of the names of the bots that won.
These arrays have an unique Elo-rating regardless of the number of players (i.e. only one for the whole team)
"""
def updateElo(losing_bots, winning_bots):
elo_winning_team = 1478 # TODO: Read Elo rating for the winning team from a database
elo_losing_team = 1658 # TODO: Read the Elo rating for the losing team from a database
exp_win = expected(elo_winning_team, elo_losing_team)
exp_lose = expected(elo_losing_team, elo_winning_team)
new_elo_winning_team = elo(elo_winning_team, exp_win, 1, k=32)
new_elo_losing_team = elo(elo_losing_team, exp_lose, 0, k=32)
print(new_elo_winning_team)
print(new_elo_losing_team)
# TODO: Write Elo rating for the winning and losing team to the database