Struct bbt::Rater [] [src]

pub struct Rater {
    // some fields omitted
}

Rater is used to calculate rating updates given the β-parameter.

Methods

impl Rater

fn new(beta: f64) -> Rater

This method instantiates a new rater with the given β-parameter.

impl Rater

fn update_ratings(&self, teams: Vec<Vec<Rating>>, ranks: Vec<usize>) -> Result<Vec<Vec<Rating>>, &'static str>

This method takes a vector of teams, with each team being a vector of player ratings, and a vector ranks of the same size that specifies the order in which the team finished a game. It returns either Err(error_message) if the input is incorrect or Ok(Vec<Vec<Rating>>). The returned vector is an updated version of the teams vector that was passed into the function.

fn duel(&self, p1: Rating, p2: Rating, outcome: Outcome) -> (Rating, Rating)

This method calculates the new ratings for two players after a head-to-head duel. The outcome is from the first player p1's perspective, i.e. Win if the first player won, Loss if the second player won and Draw if neither player won.

Trait Implementations

impl Default for Rater

fn default() -> Rater