From 010d8e688de2199ab6e10b03de64e75b2c0521d9 Mon Sep 17 00:00:00 2001 From: Thanos Apollo Date: Mon, 15 Jan 2024 10:28:49 +0200 Subject: gnosis-algorithm: Fix for first interval --- gnosis-algorithm.el | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'gnosis-algorithm.el') diff --git a/gnosis-algorithm.el b/gnosis-algorithm.el index 4107b8a..2ec859c 100644 --- a/gnosis-algorithm.el +++ b/gnosis-algorithm.el @@ -123,13 +123,13 @@ Returns a tuple: (INTERVAL N EF) where, (interval (cond ;; First successful review -> first interval - ((and (= successful-reviews 1) + ((and (= successful-reviews 0) (= success 1) (< n 10) (< ef 3.0)) (car gnosis-algorithm-interval)) ;; Second successful review -> second interval - ((and (= successful-reviews 2) + ((and (= successful-reviews 1) (< n 10) (= success 1) (< ef 3.0)) -- cgit v1.2.3 From b67e1843432cb9bb0b8a4a05d173aef579681570 Mon Sep 17 00:00:00 2001 From: Thanos Apollo Date: Mon, 15 Jan 2024 22:24:56 +0200 Subject: gnosis-algorithm: Update error checking & docstrings --- gnosis-algorithm.el | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'gnosis-algorithm.el') diff --git a/gnosis-algorithm.el b/gnosis-algorithm.el index 2ec859c..2dcd33d 100644 --- a/gnosis-algorithm.el +++ b/gnosis-algorithm.el @@ -58,7 +58,9 @@ it below 2.0" (defcustom gnosis-algorithm-ff 0.5 "Gnosis forgetting factor. -Used to calcuate new interval for failed questions." +Used to calcuate new interval for failed questions. + +NOTE: Do not change this value above 1" :group 'gnosis :type 'float) @@ -115,6 +117,11 @@ Returns a tuple: (INTERVAL N EF) where, - EF : Modified based on the recall success for the item." (cl-assert (and (>= success 0) (<= success 1))) + ;; Check if gnosis-algorithm-ff is lower than 1 & is total-ef above 1.3 + (cond ((>= gnosis-algorithm-ff 1) + (error "Value of `gnosis-algorithm-ff' must be lower than 1")) + ((< (nth 2 gnosis-algorithm-ef) 1.3) + (error "Value of total-ef from `gnosis-algorithm-ef' must be above 1.3"))) ;; Calculate the next easiness factor. (let* ((next-ef (gnosis-algorithm-e-factor ef success)) ;; Calculate the next interval. @@ -138,6 +145,7 @@ Returns a tuple: (INTERVAL N EF) where, ((and (= last-interval 0) (= success 1)) (* ef 1)) + ;; For everything else (t (if (= success 1) (* ef last-interval) (* ff last-interval)))))) -- cgit v1.2.3