Skip to content

Commit

Permalink
Ensure players who have weekly results remain in db
Browse files Browse the repository at this point in the history
Their rating decays, but they remain "active".
  • Loading branch information
cch1 committed Nov 7, 2021
1 parent eefd373 commit 52be76a
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/atp/glicko.clj
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@
g (g rdo)]
(* g g e (- 1 e)))))
+
0
results)))))

(defn update-player [db [player results]]
Expand All @@ -48,7 +47,6 @@
g (g rdo)]
(* g (- s e)))))
+
0
results)))
rd' (Math/sqrt (/ 1 (+ (/ 1 (* rd rd)) (/ 1 d2))))]
[player [r' rd']]))
Expand All @@ -67,7 +65,7 @@
winners (group-by :winner results)
losers (group-by :loser results)
results-by-player (into {} (map normalize-results) (merge-with concat winners losers))]
(into {} (map (partial update-player db')) results-by-player)))
(into db' (map (partial update-player db')) results-by-player)))

(defn rankings [db]
(sort-by (comp #(* -1 %) first val) db))
Expand Down

0 comments on commit 52be76a

Please sign in to comment.