Skip to content

Commit

Permalink
Test color rating advantage
Browse files Browse the repository at this point in the history
  • Loading branch information
ddugovic committed Nov 22, 2024
1 parent 274773e commit dc09657
Showing 1 changed file with 29 additions and 29 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,28 +25,28 @@ class GlickoCalculatorWithColorAdvantageTest extends ScalaCheckSuite with chess.
)
test("default deviation: white wins"):
val (w, b) = computeGame(players, Outcome.white)
assertCloseTo(w.rating, 1741d, 1d)
assertCloseTo(b.rating, 1258d, 1d)
assertCloseTo(w.deviation, 396d, 1d)
assertCloseTo(b.deviation, 396d, 1d)
assertCloseTo(w.volatility, 0.0899983, 0.00000001d)
assertCloseTo(b.volatility, 0.0899983, 0.0000001d)
assertCloseTo(w.rating, 1662d, 0.5d)
assertCloseTo(b.rating, 1338d, 0.5d)
assertCloseTo(w.deviation, 290d, 0.5d)
assertCloseTo(b.deviation, 290d, 0.5d)
assertCloseTo(w.volatility, 0.0599993d, 0.0000001d)
assertCloseTo(b.volatility, 0.0599993d, 0.0000001d)
test("default deviation: black wins"):
val (w, b) = computeGame(players, Outcome.black)
assertCloseTo(w.rating, 1258d, 1d)
assertCloseTo(b.rating, 1741d, 1d)
assertCloseTo(w.deviation, 396d, 1d)
assertCloseTo(b.deviation, 396d, 1d)
assertCloseTo(w.volatility, 0.0899983, 0.00000001d)
assertCloseTo(b.volatility, 0.0899983, 0.0000001d)
assertCloseTo(w.rating, 1338d, 0.5d)
assertCloseTo(b.rating, 1662d, 0.5d)
assertCloseTo(w.deviation, 290d, 0.5d)
assertCloseTo(b.deviation, 290d, 0.5d)
assertCloseTo(w.volatility, 0.0599993d, 0.0000001d)
assertCloseTo(b.volatility, 0.0599993d, 0.0000001d)
test("default deviation: draw"):
val (w, b) = computeGame(players, Outcome.draw)
assertCloseTo(w.rating, 1500d, 1d)
assertCloseTo(b.rating, 1500d, 1d)
assertCloseTo(w.deviation, 396d, 1d)
assertCloseTo(b.deviation, 396d, 1d)
assertCloseTo(w.volatility, 0.0899954, 0.0000001d)
assertCloseTo(b.volatility, 0.0899954, 0.0000001d)
assertCloseTo(w.rating, 1500d, 0.5d)
assertCloseTo(b.rating, 1500d, 0.5d)
assertCloseTo(w.deviation, 290d, 0.5d)
assertCloseTo(b.deviation, 290d, 0.5d)
assertCloseTo(w.volatility, 0.0599977d, 0.0000001d)
assertCloseTo(b.volatility, 0.0599977d, 0.0000001d)
}

{
Expand All @@ -64,25 +64,25 @@ class GlickoCalculatorWithColorAdvantageTest extends ScalaCheckSuite with chess.
)
test("mixed ratings and deviations: white wins"):
val (w, b) = computeGame(players, Outcome.white)
assertCloseTo(w.rating, 1422d, 1d)
assertCloseTo(b.rating, 1506d, 1d)
assertCloseTo(w.deviation, 77d, 1d)
assertCloseTo(b.deviation, 105d, 1d)
assertCloseTo(w.rating, 1423d, 0.5d)
assertCloseTo(b.rating, 1506d, 0.5d)
assertCloseTo(w.deviation, 77d, 0.5d)
assertCloseTo(b.deviation, 106d, 0.5d)
assertCloseTo(w.volatility, 0.06, 0.00001d)
assertCloseTo(b.volatility, 0.065, 0.00001d)
test("mixed ratings and deviations: black wins"):
val (w, b) = computeGame(players, Outcome.black)
assertCloseTo(w.rating, 1389d, 1d)
assertCloseTo(b.rating, 1568d, 1d)
assertCloseTo(w.deviation, 78d, 1d)
assertCloseTo(b.deviation, 105d, 1d)
assertCloseTo(w.rating, 1390d, 0.5d)
assertCloseTo(b.rating, 1569d, 0.5d)
assertCloseTo(w.deviation, 77d, 0.5d)
assertCloseTo(b.deviation, 106d, 0.5d)
assertCloseTo(w.volatility, 0.06, 0.00001d)
assertCloseTo(b.volatility, 0.065, 0.00001d)
test("mixed ratings and deviations: draw"):
val (w, b) = computeGame(players, Outcome.draw)
assertCloseTo(w.rating, 1406d, 1d)
assertCloseTo(b.rating, 1537d, 1d)
assertCloseTo(w.deviation, 78d, 1d)
assertCloseTo(w.rating, 1406d, 0.5d)
assertCloseTo(b.rating, 1538d, 0.5d)
assertCloseTo(w.deviation, 77d, 0.5d)
assertCloseTo(b.deviation, 105.87d, 0.01d)
assertCloseTo(w.volatility, 0.06, 0.00001d)
assertCloseTo(b.volatility, 0.065, 0.00001d)
Expand Down

0 comments on commit dc09657

Please sign in to comment.