From 1e6f6a6da23cc578adeb216566b5b2330229fb50 Mon Sep 17 00:00:00 2001 From: pyuk-bot Date: Wed, 18 Dec 2024 22:43:51 -0600 Subject: [PATCH 1/2] Don't let players' RD drift beyond the maximum --- src/ladder.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/ladder.ts b/src/ladder.ts index 3ab313d..a65086f 100644 --- a/src/ladder.ts +++ b/src/ladder.ts @@ -388,7 +388,10 @@ export class GlickoPlayer { // Follow along the steps using: http://www.glicko.net/glicko/glicko.pdf if (m.length === 0) { - const RD = Math.sqrt((this.rd * this.rd) + (this.c * this.c)); + let RD = Math.sqrt((this.rd * this.rd) + (this.c * this.c)); + if (RD > this.RDmax) { + RD = this.RDmax; + } return {R: this.rating, RD}; } From b88a0d94f58ddef71fa85f73a7c3fd7d4bb3c212 Mon Sep 17 00:00:00 2001 From: pyuk-bot Date: Tue, 31 Dec 2024 17:15:49 -0600 Subject: [PATCH 2/2] Always apply the change to uncertainty regardless of activity Technically, this isn't quite right either, since we're potentially applying a modifier using a constant calibrated for daily rating periods more than once per day if someone plays more than 15 games in one day. --- src/ladder.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/ladder.ts b/src/ladder.ts index a65086f..58c92d7 100644 --- a/src/ladder.ts +++ b/src/ladder.ts @@ -387,11 +387,11 @@ export class GlickoPlayer { // Follow along the steps using: http://www.glicko.net/glicko/glicko.pdf + let RD = Math.sqrt((this.rd * this.rd) + (this.c * this.c)); + if (RD > this.RDmax) { + RD = this.RDmax; + } if (m.length === 0) { - let RD = Math.sqrt((this.rd * this.rd) + (this.c * this.c)); - if (RD > this.RDmax) { - RD = this.RDmax; - } return {R: this.rating, RD}; } @@ -408,7 +408,7 @@ export class GlickoPlayer { d2 = 1.0 / this.q / this.q / d2; - let RD = 1.0 / Math.sqrt(1.0 / (this.rd * this.rd) + 1.0 / d2); + RD = 1.0 / Math.sqrt(1.0 / (RD * RD) + 1.0 / d2); const R = this.rating + this.q * (RD * RD) * A; if (RD > this.RDmax) {