glicko2

glicko2 crate glicko2 documentation

This crate implements the glicko2 rating system. It's a rating system appropriate for 1v1 games and is leveraged by many chess leagues.

Usage

This example comes straight from the glicko2 rating pdf:

```rust extern crate glicko2;

use glicko2::{GameResult, GlickoPlayer};

fn main() { let exampleplayer = GlickoPlayer { rating: 1500.0, ratingdeviation: 200.0, }; let mut results = vec![]; results.push(GameResult::win(GlickoPlayer { rating: 1400.0, ratingdeviation: 30.0, })); results.push(GameResult::loss(GlickoPlayer { rating: 1550.0, ratingdeviation: 100.0, })); results.push(GameResult::loss(GlickoPlayer { rating: 1700.0, ratingdeviation: 300.0, })); // Because we pass in a GlickoPlayer instead of a Glicko2Player, we get a GlickoPlayer back. // This means that we lose the volatility field. // If you want to preserve volatility (i.e. use Glicko2), pass in a Glicko2Player instead. let newplayer = glicko2::newrating(exampleplayer, &results, 0.5); println!( "New rating: {} New rating deviation: {}", newplayer.rating, newplayer.rating_deviation ); } ```

License

Licensed under either of

at your option.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.