summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThanos Apollo <[email protected]>2024-01-14 11:26:59 +0200
committerThanos Apollo <[email protected]>2024-01-14 12:01:28 +0200
commitf585d83f6df1498b9fa93eac7e4e37663bafb8f2 (patch)
tree40ad59ed300586d9db524ddbdb68b239d3db8c09
parent8685a85209634b4a0079c5c0d7517e6b86448697 (diff)
gnosis-algorithm-interval: Add cond for when last interval is 0
- This could occur in custom review sessions, option should be added to have the same for success 0, but I didn't have any issues _yet_, will revisit this soon - Update docstrings & add comments for this - Fix successful-reviews value
-rw-r--r--gnosis-algorithm.el18
1 files changed, 12 insertions, 6 deletions
diff --git a/gnosis-algorithm.el b/gnosis-algorithm.el
index ea23288..4107b8a 100644
--- a/gnosis-algorithm.el
+++ b/gnosis-algorithm.el
@@ -96,6 +96,9 @@ 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"))))
+;; This should be further tested for notes with last-interval of 0 when success 0
+;; For future versions of this algorithm, we should also calculate
+;; failures in row to have "leech" like notes as well.
(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.
@@ -104,6 +107,7 @@ The structure of the given date is (YEAR MONTH DAY)."
- SUCCESS : Success of the recall, ranges from 0 (unsuccessful) to 1
(successful).
- FF: Failure factor
+- SUCCESSFUL-REVIEWS : Number of successful reviews in a row.
Returns a tuple: (INTERVAL N EF) where,
- Next review date in (year month day) format.
@@ -119,19 +123,21 @@ Returns a tuple: (INTERVAL N EF) where,
(interval
(cond
;; First successful review -> first interval
- ((and (= successful-reviews 0)
+ ((and (= successful-reviews 1)
(= success 1)
+ (< n 10)
(< ef 3.0))
(car gnosis-algorithm-interval))
;; Second successful review -> second interval
- ((and (= successful-reviews 1)
+ ((and (= successful-reviews 2)
+ (< n 10)
(= success 1)
(< ef 3.0))
(cadr gnosis-algorithm-interval))
- ;; TESTING
- ;; ((and (= last-interval 0)
- ;; (= success 1))
- ;; (* ef 1))
+ ;; For custom review sessions.
+ ((and (= last-interval 0)
+ (= success 1))
+ (* ef 1))
(t (if (= success 1)
(* ef last-interval)
(* ff last-interval))))))