Module skillratings::dwz
source · Expand description
The DWZ (Deutsche Wertungszahl) algorithm used in the german chess leagues alongside Elo.
DWZ continues to be enhanced over the years, while having similar scores to Elo.
DWZ allows young players to rise and fall in the ranks more quickly, while more experienced players ratings are slower to change.
Overachieving players gain more rating while under-performing weak players do not lose rating points as quickly.
These factors make DWZ more dynamic than Elo while producing accurate ratings more quickly.
Quickstart
This is the most basic example on how to use the DWZ Module.
Please take a look at the functions below to see more advanced use cases.
use skillratings::{
dwz::{dwz, DWZRating},
Outcomes,
};
// Initialise a new player rating.
// We need to set the actual age for the player,
// if you are unsure what to set here, choose something that is greater than 25.
let player_one = DWZRating::new(19);
// Or you can initialise it with your own values of course.
// Imagine these numbers being pulled from a database.
// The default rating is 1000, and the index denotes the amount of tournaments played.
let (some_rating, some_index, some_age) = (1325.0, 51, 27);
let player_two = DWZRating {
rating: some_rating,
index: some_index,
age: some_age,
};
// The outcome of the match is from the perspective of player one.
let outcome = Outcomes::WIN;
// The dwz function will calculate the new ratings for both players and return them.
let (new_player_one, new_player_two) = dwz(&player_one, &player_two, &outcome);
More Information
Structs
- Struct to calculate ratings and expected score for
DWZRating
- The DWZ (Deutsche Wertungszahl) rating for a player.
Enums
- The error types that can occur when calculating a new DWZ Rating.
Only gets raised in theget_first_dwz
function.
Functions
- Calculates new
DWZRating
of two players based on their old rating, index, age and outcome of the game. - The “traditional” way of calculating a DWZ Rating of a player in a rating period or tournament.
- Calculates the expected outcome of two players based on DWZ.
- Calculates the expected outcome of a player in a rating period or tournament.
- Gets a proper first
DWZRating
.