Documentation ¶
Index ¶
- Constants
- type Elo
- func (e *Elo) ExpectedScore(ratingA, ratingB int) float64
- func (e *Elo) ExpectedScoreWithFactors(ratingA, ratingB, d int) float64
- func (e *Elo) Outcome(ratingA, ratingB int, score float64) (Outcome, Outcome)
- func (e *Elo) OutcomeWithFactors(ratingA, ratingB int, score float64, k, d int) (Outcome, Outcome)
- func (e *Elo) Rating(ratingA, ratingB int, score float64) int
- func (e *Elo) RatingDelta(ratingA, ratingB int, score float64) int
- func (e *Elo) RatingDeltaWithFactors(ratingA, ratingB int, score float64, k, d int) int
- func (e *Elo) RatingWithFactors(ratingA, ratingB int, score float64, k, d int) int
- type Outcome
Constants ¶
const ( // K is the default K-Factor K = 32 // D is the default deviation D = 400 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Elo ¶
Elo calculates Elo rating changes based on the configured factors.
func NewElo ¶
func NewElo() *Elo
NewElo instantiates the Elo object with default factors. Default K-Factor is 32 Default deviation is 400
func NewEloWithFactors ¶
NewEloWithFactors instantiates the Elo object with custom factor values.
func (*Elo) ExpectedScore ¶
ExpectedScore gives the expected chance that the first player wins
func (*Elo) ExpectedScoreWithFactors ¶
ExpectedScoreWithFactors overrides default factors and gives the expected chance that the first player wins
func (*Elo) OutcomeWithFactors ¶
OutcomeWithFactors overrides default factors and gives an Outcome object for each player for the given score
func (*Elo) RatingDelta ¶
RatingDelta gives the ratings change for the first player for the given score
func (*Elo) RatingDeltaWithFactors ¶
RatingDeltaWithFactors overrides default factors and gives the ratings change for the first player for the given score