sublee / trueskill

An implementation of the TrueSkill rating system for Python
https://trueskill.org/
Other
742 stars 112 forks source link

in section rating_groups, what is 'player.team'? #8

Closed jcquarto closed 9 years ago

jcquarto commented 10 years ago

in the api docs there's a reference to rating_groups, and the code:

calculate new ratings

rating_groups = [{p1: p1.rating, p2: p2.rating}, {p3: p3.rating}] rated_rating_groups = env.rate(rating_groups, ranks=[0, 1])

save new ratings

for player in [p1, p2, p3]: player.rating = rated_rating_groups[player.team][player]

where does player.team come from? this seems pulled out of thin air ...

sublee commented 10 years ago

A player is an arbitrary object. player.team means that just the index of a rating group where the player belongs to. In the above case, teams are [0, 0, 1].

sublee commented 9 years ago

@jcquarto Did my reply help you? If so, close this issue please. If you don't respond for a week, I'll close it myself.