diff options
Diffstat (limited to 'gnosis-algorithm.el')
-rw-r--r-- | gnosis-algorithm.el | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/gnosis-algorithm.el b/gnosis-algorithm.el index 4107b8a..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. @@ -123,13 +130,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)) @@ -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)))))) |