summaryrefslogtreecommitdiff
path: root/gnosis-algorithm.el
diff options
context:
space:
mode:
Diffstat (limited to 'gnosis-algorithm.el')
-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))))))