diff options
author | Thanos Apollo <[email protected]> | 2023-12-27 06:42:48 +0200 |
---|---|---|
committer | Thanos Apollo <[email protected]> | 2023-12-27 06:43:58 +0200 |
commit | 81b79b4f6ec5295677c29c385711c5f3b81a6ce3 (patch) | |
tree | 60d568501f6228cfe298eeaedd40a502490b8822 /gnosis-algorithm.el | |
parent | 6b8d8f418b229bc2bd030dbda14ac08c9903f585 (diff) |
algorithm: Use consecutive successful reviews
Use consecutive successful to calculate next interval, for now just
the first 2.
Diffstat (limited to 'gnosis-algorithm.el')
-rw-r--r-- | gnosis-algorithm.el | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/gnosis-algorithm.el b/gnosis-algorithm.el index 3295e50..fee5624 100644 --- a/gnosis-algorithm.el +++ b/gnosis-algorithm.el @@ -91,7 +91,7 @@ The structure of the given date is (YEAR MONTH DAY)." (+ ef (car gnosis-algorithm-ef))) (t (error "Invalid quality score passed to gnosis-algorithm-e-factor")))) -(defun gnosis-algorithm-next-interval (last-interval n ef success ff) +(defun gnosis-algorithm-next-interval (last-interval n ef success ff successful-reviews) "Calculate next interval. - LAST-INTERVAL : The number of days since the item was last reviewed. - N : Number of times the item has been reviewed. @@ -111,11 +111,18 @@ Returns a tuple: (INTERVAL N EF) where, ;; Calculate the next interval. (interval (cond - ;; Immediately next day if it's the first time review. - ((<= n 1) (car gnosis-algorithm-interval)) - ;; After 3 days if it's second review. - ((= n 2) (cadr gnosis-algorithm-interval)) - ;; Increase last interval by 1 if recall was successful. Keep last interval if unsuccessful. + ;; First successful review -> first interval + ((and (= successful-reviews 0) + (= success 1)) + (car gnosis-algorithm-interval)) + ;; Second successful review -> second interval + ((and (= successful-reviews 1) + (= success 1)) + (cadr gnosis-algorithm-interval)) + ;; TESTING + ((and (= last-interval 0) + (= success 1)) + (* ef 1)) (t (if (= success 1) (* ef last-interval) (* ff last-interval)))))) |