atomflunder / skillratings

Rust library for popular skill rating algorithms like Elo, Glicko-2, TrueSkill and many more.
https://docs.rs/skillratings/
Apache License 2.0
41 stars 4 forks source link

Support for more than two teams in Weng-Lin #5

Closed asyncth closed 1 year ago

asyncth commented 1 year ago

Probably shouldn't be that difficult to do, my primary reason to want this is to be able to calculate ratings for free-for-all matches. I probably can implement this myself, not sure what the API should look like though.

atomflunder commented 1 year ago

Hi, thanks again for the request!

I have been looking into multi-team rating for a bit for the TrueSkill algorithm, but since that is quite complex I have only a non-functioning prototype that I have always put off fixing. I think it should be easier for the Weng-Lin algorithm. If you want to go ahead, it would be much appreciated of course!

As for the API, it will not be compatible with the Outcomes enum. I would be fine with either a new enum or just type called something like MultiTeamOutcome or FFAOutcome or whatever sounds the best, and having a rank as usize inside it indicating team placements. Or just passing in the rating groups together with a usize indicating the rank directly into the rating function (Like the argument would be rating_groups: &[(&[WengLinRating], usize)]). But I am also open for something else if you have a better suggestion.

asyncth commented 1 year ago

Back to this profile.

Is MultiTeamOutcome supposed to be passed into a function in a tuple, just like usize example?

atomflunder commented 1 year ago

Is MultiTeamOutcome supposed to be passed into a function in a tuple, just like usize example?

I could see having either either rating_groups: &[(&[WengLinRating], MultiTeamOutcome)], or rating_groups: &[&[WengLinRating]], outcomes: &[MultiTeamOutcome] working fine, what do you think?

asyncth commented 1 year ago

I like former one more I guess.

asyncth commented 1 year ago

What should be the name of this new function? Or should the original team function be modified instead?

atomflunder commented 1 year ago

What should be the name of this new function? Or should the original team function be modified instead?

I like having a Team vs Team function as a shortcut, with more efficient calculations, so I personally would say we re-name the original function weng_ling_two_teams (or similar) and name the new function weng_lin_multi_team. I think the naming might be confusing to users otherwise. But, as always, I am open to better suggestions.