Skip to content

Commit 94489ef

Browse files
committed
Rating color advantage test WIP (lichess-org#598)
1 parent 9915021 commit 94489ef

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

test-kit/src/test/scala/rating/glicko/GlickoCalculatorWithColorAdvantageTest.scala

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,18 @@ package glicko
55
class GlickoCalculatorWithColorAdvantageTest extends ChessTest:
66

77
import Outcome.*
8+
// http://www.glicko.net/glicko/glicko2.pdf
9+
// If the player is unrated, set the rating to 1500
10+
// and the RD to 350. Set the player’s volatility to
11+
// 0.06 (this value depends on the particular application)
12+
val RD: Double = 350d
13+
val V: Double = 0.06d
814

915
private def ratingDiff(r: Int, opRating: Int, outcome: Outcome, expected: Int)(using
1016
munit.Location
1117
) =
12-
val player = Player(Glicko(r, 1d, 1d))
13-
val opponent = Player(Glicko(opRating, 1d, 1d))
18+
val player = Player(Glicko(r, RD, V))
19+
val opponent = Player(Glicko(opRating, RD, V))
1420
val game = Game(ByColor(player, opponent), outcome)
1521
// TODO: calculator with color advantage
1622
val calculator = GlickoCalculator()

0 commit comments

Comments
 (0)