Skip to content

TrueSkill Through Time implementation in Scala for 2-player games without draws

Notifications You must be signed in to change notification settings

ankurdave/ttt-scala

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

TrueSkill Through Time in Scala

This is a port of MSR Cambridge's TrueSkill Through Time algorithm from F# to Scala. The port simplifies the code for use in the Cal Squash box league rankings.

Example usage (try it out with sbt console):

import com.ankurdave.ttt._
import com.ankurdave.ttt.implicits._
import java.time.YearMonth

val games = new Games(Seq(
  Game(YearMonth.of(2017, 1), PlayerId("A"), PlayerId("B")),
  Game(YearMonth.of(2017, 1), PlayerId("C"), PlayerId("D")),
  Game(YearMonth.of(2017, 1), PlayerId("E"), PlayerId("F")),
  Game(YearMonth.of(2017, 2), PlayerId("B"), PlayerId("C")),
  Game(YearMonth.of(2017, 2), PlayerId("D"), PlayerId("E"))))

val skillVariables = new TTT(games).run()

skillVariables((YearMonth.of(2017, 2), PlayerId("B")))
// res0: com.ankurdave.ttt.Gaussian = Gaussian(mu=16.374122, sigma=3.501964)

skillVariables((YearMonth.of(2017, 2), PlayerId("D")))
// res1: com.ankurdave.ttt.Gaussian = Gaussian(mu=14.698318, sigma=3.375058)

About

TrueSkill Through Time implementation in Scala for 2-player games without draws

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages