sglicko2 – Glicko-2 for Scala

A small, simple and self-contained implementation of the Glicko-2 rating algorithm in Scala that also helps the user with maintaining a leaderboard and allows for custom scoring rules.

View the Project on GitHub asflierl/sglicko2

sglicko2 Build Status Download Join the chat at https://gitter.im/asflierl/sglicko2 Get automatic notifications about new versions of sglicko2

A small, simple & self-contained implementation of the Glicko-2 rating algorithm in Scala that also helps the user with maintaining a leaderboard and allows for custom scoring rules.

Setup

Version 1.4 is currently available for Scala 2.11 and 2.12. The last version to support Scala 2.10 was 1.3. To use this library in your SBT project, add the following to your build definition:

resolvers += "jcenter" at "http://jcenter.bintray.com"
libraryDependencies += "sglicko2" %% "sglicko2" % "1.3"

Usage

Here's a simple, runnable example on how the library can be used:

import sglicko2._, EitherOnePlayerWinsOrItsADraw._

object Example extends App {
  val glicko2 = new Glicko2[Symbol, EitherOnePlayerWinsOrItsADraw]

  val ratingPeriod = glicko2.newRatingPeriod.withGames(
    ('Abby, 'Becky, Player1Wins),
    ('Abby, 'Chas, Player1Wins),
    ('Abby, 'Dave, Player1Wins),
    ('Becky, 'Chas, Player2Wins),
    ('Becky, 'Dave, Draw),
    ('Chas, 'Dave, Player2Wins))

  val leaderboard = glicko2.updatedLeaderboard(glicko2.newLeaderboard, ratingPeriod)

  leaderboard.rankedPlayers foreach println
}

You can find more example code in the test sources. The main sources should be very easy to understand, too, so don't hesitate to look at those if you have questions.

Also, if you use this library, I'd love to hear from you. Thanks <3