rankings

package
v0.0.0-...-351bd47 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 10, 2018 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DefaultRatings

func DefaultRatings(players []int64) map[int64]Rating

Types

type Ranking

type Ranking struct {
	PlayerID int64
	Rating   Rating
	Rank     int
}

type Rankings

type Rankings []Ranking

func RateGames

func RateGames(players []int64, games []Result) (Rankings, error)

func (Rankings) Len

func (r Rankings) Len() int

func (Rankings) Less

func (r Rankings) Less(i, j int) bool

func (Rankings) ProposeGame

func (rankings Rankings) ProposeGame() (int64, int64, error)

ProposeGame returns the IDs of two players who should play the next game.

func (Rankings) Swap

func (r Rankings) Swap(i, j int)

type Rating

type Rating struct {
	Mean   float64
	Stddev float64
}

func (Rating) String

func (r Rating) String() string

type Result

type Result struct {
	WhiteID int64
	BlackID int64
	Outcome game.Outcome
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL