Module skillratings::glicko

source ·
Expand description

The Glicko algorithm, developed by Mark Glickman as an improvement on Elo.
It is still being used in some games in favour Glicko-2, such as Pokémon Showdown, Chess.com and Quake Live.

If you are looking for the updated Glicko-2 rating system, please see Glicko-2.

The main improvement over Elo is the rating deviation introduced, which decreases over time as the player plays more matches and the rating becomes more reliable. This allows players to rise and fall through the ranks quickly at the beginning, and not gain or lose as much rating points after completing more matches.

Quickstart

This is the most basic example on how to use the Glicko Module.
Please take a look at the functions below to see more advanced use cases.

use skillratings::{
    glicko::{glicko, GlickoConfig, GlickoRating},
    Outcomes,
};

// Initialise a new player rating with a rating of 1500 and a deviation of 350.
let player_one = GlickoRating::new();

// Or you can initialise it with your own values of course.
// Imagine these numbers being pulled from a database.
let (some_rating, some_deviation) = (1325.0, 230.0);
let player_two = GlickoRating {
    rating: some_rating,
    deviation: some_deviation,
};

// The outcome of the match is from the perspective of player one.
let outcome = Outcomes::WIN;

// The config allows you to specify certain values in the Glicko calculation.
// Here we set the c value to 23.75, instead of the default 63.2.
// This will decrease the amount by which rating deviation increases per rating period.
let config = GlickoConfig { c: 23.75 };

// The glicko function will calculate the new ratings for both players and return them.
let (new_player_one, new_player_two) = glicko(&player_one, &player_two, &outcome, &config);

More Information

Structs

Functions