diff options
author | Thanos Apollo <[email protected]> | 2024-03-01 23:23:29 +0200 |
---|---|---|
committer | Thanos Apollo <[email protected]> | 2024-03-01 23:23:29 +0200 |
commit | bbdc2c296a71d7738309a74b309ad2600af8a657 (patch) | |
tree | 5b5a2d16778e2704ab00e2cb41664c27c6c20bda | |
parent | 2525388d53f911005762463769b2e4e16ee41796 (diff) |
gnosis-algorithm-next-ef: Adjust for 0
If c-successes/c-failures is 0 change-p would return t, triggering the
update frequency. Using max 1 would fixes this.
-rw-r--r-- | gnosis-algorithm.el | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/gnosis-algorithm.el b/gnosis-algorithm.el index 64c08c3..be91c53 100644 --- a/gnosis-algorithm.el +++ b/gnosis-algorithm.el @@ -124,7 +124,7 @@ reviews, increase the ef increase value (first item) by INCREASE. For every FREQUENCY of C-FAILURES reviews, decrease the ef decrease value (second item) by DECREASE." - (let ((change-p (= (% (if success c-successes c-failures) frequency) 0)) + (let ((change-p (= (% (max 1 (if success c-successes c-failures)) frequency) 0)) (new-ef (if success (gnosis-algorithm-replace-at-index 2 (+ (nth 2 ef) (nth 0 ef)) ef) (gnosis-algorithm-replace-at-index 2 (max 1.3 (- (nth 2 ef) (nth 1 ef))) ef)))) (cond ((and success change-p) |