glicko2 0.1.0

Implementation of the glicko2 rating system
Documentation

Usage

extern crate glicko2;

use glicko2::{GameResult, GlickoPlayer};

fn main() {
    let example_player = GlickoPlayer {
        rating: 1500.0,
        rating_deviation: 200.0,
    };
    let mut results: [GameResult; 3] = unsafe { ::std::mem::uninitialized() };
    results[0] = GameResult::win(GlickoPlayer {
        rating: 1400.0,
        rating_deviation: 30.0,
    });
    results[1] = GameResult::loss(GlickoPlayer {
        rating: 1550.0,
        rating_deviation: 100.0,
    });
    results[2] = GameResult::loss(GlickoPlayer {
        rating: 1700.0,
        rating_deviation: 300.0,
    });
    // Because we are passing 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 new_player = glicko2::new_rating(example_player, &results, 0.5);
    println!("New rating: {} New rating deviation: {}", new_player.rating, new_player.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.