Function skillratings::trueskill::match_quality
source · pub fn match_quality(
player_one: &TrueSkillRating,
player_two: &TrueSkillRating,
config: &TrueSkillConfig
) -> f64
Expand description
Gets the quality of the match, which is equal to the probability that the match will end in a draw. The higher the Value, the better the quality of the match.
Takes in two players as TrueSkillRating
s and returns the probability of a draw occurring as an f64
between 1.0 and 0.0.
Similar to match_quality_two_teams
.
Examples
use skillratings::trueskill::{match_quality, TrueSkillConfig, TrueSkillRating};
let player_one = TrueSkillRating::new();
let player_two = TrueSkillRating::new();
let config = TrueSkillConfig::new();
let quality = match_quality(&player_one, &player_two, &config);
// According to TrueSkill, there is a 44.7% chance this match will end in a draw.
assert!(((quality * 1000.0).round() - 447.0).abs() < f64::EPSILON);