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

    // Required methods
    fn new(config: Self::CONFIG) -> Self;
    fn rate(
        &self,
        player: &Self::RATING,
        results: &[(Self::RATING, Outcomes)]
    ) -> Self::RATING;
    fn expected_score(
        &self,
        player: &Self::RATING,
        opponents: &[Self::RATING]
    ) -> Vec<f64>;
}
Expand description

Rating system for rating periods.

📌 Important note: The RatingPeriodSystem Trait only implements the rate and expected_score functions.
Some rating systems might also implement additional functions 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: &Self::RATING, results: &[(Self::RATING, Outcomes)] ) -> Self::RATING

Calculate ratings for a player based on provided list of opponents and outcomes.

source

fn expected_score( &self, player: &Self::RATING, opponents: &[Self::RATING] ) -> Vec<f64>

Calculate expected scores for a player and a list of opponents. Returns probabilities of the player winning from 0.0 to 1.0.

Object Safety§

This trait is not object safe.

Implementors§