pub trait RatingSystem {
    type RATING: Rating + Copy + Debug;
    type CONFIG;

    // Required methods
    fn new(config: Self::CONFIG) -> Self;
    fn rate(
        &self,
        player_one: &Self::RATING,
        player_two: &Self::RATING,
        outcome: &Outcomes
    ) -> (Self::RATING, Self::RATING);
    fn expected_score(
        &self,
        player_one: &Self::RATING,
        player_two: &Self::RATING
    ) -> (f64, f64);
}
Expand description

Rating system for 1v1 matches.

📌 Important note: The RatingSystem Trait only implements the rate and expected_score functions.
Some rating systems might also implement additional functions (confidence interval, match quality, etc.) which you can only access by using those directly.

Required Associated Types§

source

type RATING: Rating + Copy + Debug

Rating type rating system.

source

type CONFIG

Config type for rating system.

Required Methods§

source

fn new(config: Self::CONFIG) -> Self

Initialise rating system with provided config. If the rating system does not require a config, leave empty brackets.

source

fn rate( &self, player_one: &Self::RATING, player_two: &Self::RATING, outcome: &Outcomes ) -> (Self::RATING, Self::RATING)

Calculate ratings for two players based on provided ratings and outcome.

source

fn expected_score( &self, player_one: &Self::RATING, player_two: &Self::RATING ) -> (f64, f64)

Calculate expected outcome of two players. Returns probability of player winning from 0.0 to 1.0.

Object Safety§

This trait is not object safe.

Implementors§