pub struct Rater { /* private fields */ }Expand description
Rater is used to calculate rating updates given the β-parameter.
Implementations§
Source§impl Rater
impl Rater
Sourcepub fn update_ratings<Ranks>(
&self,
teams: &mut [&mut [&mut Rating]],
ranks: Ranks,
) -> Result<(), BBTError>
pub fn update_ratings<Ranks>( &self, teams: &mut [&mut [&mut Rating]], ranks: Ranks, ) -> Result<(), BBTError>
This method takes a mutable slice of teams, with each team being a
mutable slice of (mutable) player ratings, and a slice, Vec or array of
usize ranks of the same size. The ranks specify the ranking of the
corresponding team in the game (1st, 2nd, etc.). The ratings are updated
in place.
Returns Err(BBTError) if the input is incorrect, otherwise Ok(()).
Sourcepub fn duel(&self, p1: &mut Rating, p2: &mut Rating, outcome: Outcome)
pub fn duel(&self, p1: &mut Rating, p2: &mut Rating, outcome: Outcome)
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. The ratings are updated
in place.
Trait Implementations§
impl Copy for Rater
Auto Trait Implementations§
impl Freeze for Rater
impl RefUnwindSafe for Rater
impl Send for Rater
impl Sync for Rater
impl Unpin for Rater
impl UnwindSafe for Rater
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more