elo: github.com/ethanmad/elo Index | Files

package elo

import "github.com/ethanmad/elo"


Package Files


func ExpectedScore Uses

func ExpectedScore(ratingA, ratingB int) float64

ExpectedScore returns the expected score (chance of winning) of Player A. The expected score of Player B is 1 - ExpectedScore(ratingA, ratingB). This function can be used to predict matchups without alone. Equation: ExpectedScoreA = 1 / (1 + 10^{(ratingB - ratingA)/deviation}).

type Match Uses

type Match struct {
    W, L *Player
    Draw bool

Match contains two *Players: w is the winner, l is the loser. If draw is set, the order of *Players doesn't matter.

func (*Match) Play Uses

func (m *Match) Play()

Play updates the ratings based on the match results by modifying the Players referenced by m.

type Player Uses

type Player struct {
    Rating int

Player contains the Player's rating. Using a struct to support the future addition of other information.

Package elo imports 1 packages (graph). Updated 2019-05-09. Refresh now. Tools for package owners.