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

Add partial play weights to the full TrueSkill calculations #12

Open atomflunder opened 3 months ago

atomflunder commented 3 months ago

TrueSkill has the capability for partial play weights, accounting for players who have not played the whole match. These can range from 0.0 (no participation) to 1.0 (full match).

This crate should probably implement these, although I am undecided on how to best do it to be as user-friendly as possible. Passing a partial play weight in every time could be pretty annoying to the user, since in 99.9% of cases, it will be set to 1.0.

Rust doesn't use default values for arguments unfortunately, I think those would come in useful here.

// How it is currently done:
pub fn trueskill_multi_team(
    teams_and_ranks: &[(&[TrueSkillRating], MultiTeamOutcome)],
    config: &TrueSkillConfig,
) -> Vec<Vec<TrueSkillRating>>

// This seems annoying?
// Would also interfere with the RatingSystem Trait
pub fn trueskill_multi_team(
    teams_and_ranks: &[(&[(TrueSkillRating, f64)], MultiTeamOutcome)],
    config: &TrueSkillConfig,
) -> Vec<Vec<TrueSkillRating>>

Maybe it's useful to offer 2 different functions, one with and one without weights? Does seem a bit "bloaty" to me though.

Also, I think this only makes sense to implement for the full trueskill_multi_team and match_quality_multi_team functions, and not the 1-vs-1 and Team-vs-Team shortcuts.
For the match quality, the Matrix implementation also has to be updated in two places in the create_rotated_a_matrix function.
Not sure about the expected_score_multi_team function at the moment.

I think the technical implementation will be fairly straight-forward, but the design choices will be more difficult here. I also wouldn't call this issue urgent, but it would be nice to have eventually, before an eventual 1.0 release.