-
-
Notifications
You must be signed in to change notification settings - Fork 73
Use max rating deviation per team to calculate match quality #1060
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -325,17 +325,17 @@ def assign_game_quality( | |
| minority_bonus = min(minority_bonus, config.MINORITY_BONUS) | ||
| rating_disparity = abs(match[0].cumulative_rating - match[1].cumulative_rating) | ||
| unfairness = rating_disparity / config.MAXIMUM_RATING_IMBALANCE | ||
| deviation = statistics.pstdev(ratings) | ||
| rating_variety = deviation / config.MAXIMUM_RATING_DEVIATION | ||
| max_team_deviation = max(map(statistics.pstdev, [match[0].displayed_ratings, match[1].displayed_ratings])) | ||
| max_rating_variety = max_team_deviation / config.MAXIMUM_RATING_DEVIATION | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I would keep the name rating_variety here
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. but the point is that it is the maximum rating variety of all teams |
||
|
|
||
| # Visually this creates a cone in the unfairness-rating_variety plane | ||
| # that slowly raises with the time bonuses. | ||
| quality = 1 - sqrt(unfairness ** 2 + rating_variety ** 2) + time_bonus + minority_bonus | ||
| quality = 1 - sqrt(unfairness ** 2 + max_rating_variety ** 2) + time_bonus + minority_bonus | ||
| if not any(team.has_high_rated_player() for team in match): | ||
| quality += newbie_bonus | ||
| self._logger.debug( | ||
| "bonuses: %s rating disparity: %s -> unfairness: %f deviation: %f -> variety: %f -> game quality: %f", | ||
| newbie_bonus + time_bonus + minority_bonus, rating_disparity, unfairness, deviation, rating_variety, quality | ||
| newbie_bonus + time_bonus + minority_bonus, rating_disparity, unfairness, max_team_deviation, max_rating_variety, quality | ||
| ) | ||
| return GameCandidate(match, quality) | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -80,10 +80,10 @@ def test_team_matchmaker_algorithm(player_factory): | |
|
|
||
| matches, unmatched = matchmaker.find(s, 4, 1000) | ||
|
|
||
| assert set(matches[1][0].get_original_searches()) == {c1, s[2], s[5]} | ||
| assert set(matches[1][1].get_original_searches()) == {c3, s[1], s[6]} | ||
| assert set(matches[0][0].get_original_searches()) == {c4, s[4]} | ||
| assert set(matches[0][1].get_original_searches()) == {c2, s[0], s[3]} | ||
| assert set(matches[0][0].get_original_searches()) == {c1, s[2], s[5]} | ||
| assert set(matches[0][1].get_original_searches()) == {c3, s[1], s[6]} | ||
| assert set(matches[1][0].get_original_searches()) == {c4, s[4]} | ||
| assert set(matches[1][1].get_original_searches()) == {c2, s[0], s[3]} | ||
|
Comment on lines
+83
to
+86
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why did this change?
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. the tests were not passing (i think even before the change) and this part actually looked wrong, at least the way I made sense of it this should be the correct assertions, but I am not sure. |
||
| assert set(unmatched) == {s[7]} | ||
| for match in matches: | ||
| assert matchmaker.assign_game_quality(match, 4, 1000).quality > config.MINIMUM_GAME_QUALITY | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why are you using displayed ratings here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was looking for the ratings separately for each team, I was not sure which is the correct value to use. Which value do you suggest to use?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use average_rating of the original searches like it is done here:
server/server/matchmaker/algorithm/team_matchmaker.py
Lines 311 to 312 in 871c64e