-
Notifications
You must be signed in to change notification settings - Fork 63
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
Feature/#727 refactor matchmaker for 4v4 party algorithm #749
Feature/#727 refactor matchmaker for 4v4 party algorithm #749
Conversation
Github doesn't seem to re-use files for several diffs where a single file has been split into two. To get smaller diffs, you can compare |
Codecov Report
|
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 agree that there is no point in many of the objects used. If they're just holding 1 instance variable then that could really be moved to a function parameter.
447a6a9
to
7fff817
Compare
I finally included the suggestion to return a list of unmatched searches from the matchmakers, rather than taking the difference after the fact. |
fbf71ee
to
f1e1bc6
Compare
if team_size != 1: | ||
self._logger.error( | ||
"Invalid team size %i for stable marriage matchmaker will be ignored", | ||
team_size, | ||
) |
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.
Should there be a return 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.
No, I wouldn't say so - it will simply ignore what you passed in and the parameter is only there to comply with the Matchmaker
interface. By "ignore" I mean it will continue to execute as if you had passed a team_size
of 1 (and implicitly assume that all Search
es passed in searches
correspond to a single player).
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.
Oh ok. So really the parameter is always ignored, and here it's just logging that something weird is going on. Wouldn't it be better to just assert team_size == 1
then to avoid programming errors?
81f2e21
to
88de96e
Compare
Move _register_unmatched_searches into matchmaker_queue, add searches as an argument to Matchmaker.find
and minor changes to satisfy static checkers
679dc35
to
bce3504
Compare
bce3504
to
d9a314f
Compare
3bb3125
to
5c25361
Compare
…-for-4v4-party-algorithm
Refactors
server/matchmaker/algorithm.py
such that the matchmaking algorithm is independent from the queue logic, with the intent that @BlackYps can simply subclass a newMatchmaker
to propose a new algorithm.For now I stuck to minimal/minor changes, although I think these files could still benefit a lot from more attention. For example I'm not convinced that these
Matchmaker
s should have instance variables at all but left that as-is for a chance to get feedback first.Closes #801.