Glicko2
Implementation of the glicko2 rating system in Rust
Install / Use
/learn @DenialAdams/Glicko2README
glicko2
This crate implements the glicko2 rating system. It's a rating system appropriate for rating a team or player and is leveraged by many chess leagues.
Usage
This example comes straight from the glicko2 rating pdf:
extern crate glicko2;
use glicko2::{GameResult, GlickoRating};
fn main() {
let example_rating = GlickoRating {
value: 1500.0,
deviation: 200.0,
};
let mut results = vec![];
results.push(GameResult::win(GlickoRating {
value: 1400.0,
deviation: 30.0,
}));
results.push(GameResult::loss(GlickoRating {
value: 1550.0,
deviation: 100.0,
}));
results.push(GameResult::loss(GlickoRating {
value: 1700.0,
deviation: 300.0,
}));
// We are converting the result of new_rating to a GlickoRating immediately, throwing away the
// benefits of Glicko2 over Glicko for the sake of matching the example in the glicko2 pdf.
// In a real application, you'd likely want to save the Glicko2Rating and convert to
// GlickoRating for display purposes only.
let new_rating: GlickoRating = glicko2::new_rating(example_rating.into(), &results, 0.5).into();
println!(
"New rating value: {} New rating deviation: {}",
new_rating.value,
new_rating.deviation
);
}
License
Licensed under either of
- Apache License, Version 2.0, (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)
- MIT license (LICENSE-MIT or http://opensource.org/licenses/MIT)
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.
Related Skills
himalaya
349.2kCLI to manage emails via IMAP/SMTP. Use `himalaya` to list, read, write, reply, forward, search, and organize emails from the terminal. Supports multiple accounts and message composition with MML (MIME Meta Language).
node-connect
349.2kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
taskflow
349.2kname: taskflow description: Use when work should span one or more detached tasks but still behave like one job with a single owner context. TaskFlow is the durable flow substrate under authoring layer
frontend-design
109.5kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
