glicko-0.1.1.1: Glicko-2 implementation in Haskell.

LicenseGPL-3
Maintainerprillan91@gmail.com
Stabilityexperimental
Safe HaskellNone
LanguageHaskell2010

Ranking.Glicko.Core

Description

This module contains the main function, compute. Use this to compute new ratings from old ones.

>>> let ps = compute [] [Match 1 2 1 0] def
>>> ps
[ Player { _pid = 1
         , _rating = 1662.3108939062977
         , _dev = 290.31896371798047
         , _vol = 5.999967537233814e-2
         , _inactivity = 0
         , _age = 1 }
, Player { _pid = 2
         , _rating = 1337.6891060937023
         , _dev = 290.31896371798047
         , _vol = 5.999967537233814e-2
         , _inactivity = 0
         , _age = 1 }]
>>> compute ps [Match 1 3 0 0] def
[ Player { _pid = 1
         , _rating = 1623.996484575735
         , _dev = 256.3451684359266
         , _vol = 5.999869083062934e-2
         , _inactivity = 0
         , _age = 2 }
, Player { _pid = 2
         , _rating = 1337.6891060937023
         , _dev = 290.5060065906196
         , _vol = 5.999967537233814e-2
         , _inactivity = 1
         , _age = 2 }
, Player { _pid = 3
         , _rating = 1557.6214863132009
         , _dev = 286.9272058793522
         , _vol = 5.999899836136578e-2
         , _inactivity = 0
         , _age = 1 }]

Synopsis

Documentation

compute Source #

Arguments

:: [Player]

Input players

-> [Match]

Matches played this period

-> GlickoSettings

Settings for computing the score values and adding new players.

-> [Player]

Updated player ratings

Computes new ratings from the previous and adds new ones using the specified settings.

computeP :: Int -> [Player] -> [Match] -> GlickoSettings -> [Player] Source #

Same as compute but runs in parallel using the specified chunkSize

newToOld :: Player -> Player Source #

Convert ratings from Glicko-2 to Glicko

oldToNew :: Player -> Player Source #

Convert ratings from Glicko to Glicko-2