glicko v0.3.0 Glicko.Result
Convenience functions for handling a result against an opponent.
Usage
iex> opponent = Player.new_v2
iex> Result.new(opponent, 1.0)
{0.0, 2.014761872416068, 1.0}
iex> Result.new(opponent, :draw) # With shortcut
{0.0, 2.014761872416068, 0.5}
Link to this section Summary
Functions
Creates a new result from an opponent and score
Creates a new result from an opponent rating, opponent rating deviation and score
Convenience function for accessing an opponent’s rating
Convenience function for accessing an opponent’s rating deviation
Convenience function for accessing the score
Link to this section Types
t() :: {Glicko.Player.rating_t(), Glicko.Player.rating_deviation_t(), score_t()}
Link to this section Functions
new(opponent :: Glicko.Player.t(), score :: score_t() | score_shortcut_t()) :: t()
Creates a new result from an opponent and score.
Supports passing either :loss
, :draw
, or :win
as shortcuts.
new(Glicko.Player.rating_t(), Glicko.Player.rating_deviation_t(), score_t() | score_shortcut_t()) :: t()
Creates a new result from an opponent rating, opponent rating deviation and score.
Supports passing either :loss
, :draw
, or :win
as shortcuts.
opponent_rating(result :: Result.t()) :: Glicko.Player.rating_t()
Convenience function for accessing an opponent’s rating.
opponent_rating_deviation(result :: Result.t()) :: Glicko.Player.rating_deviation_t()
Convenience function for accessing an opponent’s rating deviation.
Convenience function for accessing the score.