Versions in this module Expand all Collapse all v0 v0.5.1 Nov 30, 2020 v0.5.0 Jun 30, 2019 Changes in this version + const PeriodDay + const PeriodMonth + const PeriodWeek + const PeriodYear + func AsRoundrobin(ratings map[Element]rating.Rating, scores map[Element]float64) error + type ApplyStrategy func(map[Element]rating.Rating, map[Element]float64) error + type Clock interface + Now func() time.Time + type Config struct + DefaultApplyStrategy ApplyStrategy + PeriodToResetDeviation time.Duration + RatingPeriod time.Duration + Tau float64 + func NewConfig() *Config + func (c *Config) InitialVolatility() float64 + func (c *Config) WithApplyStrategy(strategy ApplyStrategy) *Config + func (c *Config) WithClock(clock Clock) *Config + func (c *Config) WithRatingPeriod(period time.Duration) *Config + func (c *Config) WithTau(tau float64) *Config + type Element interface + ApplyMatch func(rating.Rating, float64) error + Name func() string + Prepare func(time.Time, *Config) error + Rating func() rating.Rating + type Match struct + func (m *Match) Add(element Element, score float64) error + func (m *Match) Apply(scoresAt time.Time, config *Config) error + func (m *Match) Ratings() map[Element]rating.Rating + func (m *Match) Reset() + func (m *Match) Scores() map[Element]float64 + func (m *Match) String() string + func (m *Match) WinProbs() map[Element]float64 + type Player struct + func (p *Player) ApplyMatch(opponent rating.Rating, score float64) error + func (p *Player) Name() string + func (p *Player) Prepare(outcomeAt time.Time, config *Config) error + func (p *Player) Rating() rating.Rating + func (p *Player) String() string + type Players []*Player + type Service struct + func New(config *Config) *Service + func (s *Service) Apply(match *Match) error + func (s *Service) ApplyWithTime(match *Match, outcomeAt time.Time) error + func (s *Service) NewDefaultPlayer(name string) *Player + func (s *Service) NewMatch(elements ...Element) (*Match, error) + func (s *Service) NewPlayer(name string, fixed rating.Rating, fixedAt time.Time) *Player + func (s *Service) NewTeam(name string, members Players) *Team + type Team struct + func (t *Team) ApplyMatch(opponent rating.Rating, score float64) error + func (t *Team) Name() string + func (t *Team) Prepare(outcomeAt time.Time, config *Config) error + func (t *Team) Rating() rating.Rating + func (t *Team) String() string