summaryrefslogtreecommitdiff
path: root/gnosis-algorithm.el
diff options
context:
space:
mode:
authorThanos Apollo <[email protected]>2024-01-14 19:01:33 +0200
committerThanos Apollo <[email protected]>2024-01-14 19:01:33 +0200
commit8ca53e1a0e7f1cde295b2aab29893439be07a89a (patch)
tree3c9e667fe0a778e3954992bedd15a6106c5fe5f4 /gnosis-algorithm.el
parentfadc296ccca067a22a929524f62f5007de0d7e1f (diff)
parentf9f9c31bc38bb8b6475d59c5f6f6499ddf1619a8 (diff)
Merge branch version '0.1.0' into master0.1.0
This is marks the first "release" of gnosis, it's still under heavy development, but the fundamental use is there. More features will be added in the future, that should not affect notes created using this version.
Diffstat (limited to 'gnosis-algorithm.el')
-rw-r--r--gnosis-algorithm.el28
1 files changed, 18 insertions, 10 deletions
diff --git a/gnosis-algorithm.el b/gnosis-algorithm.el
index ab94559..4107b8a 100644
--- a/gnosis-algorithm.el
+++ b/gnosis-algorithm.el
@@ -32,12 +32,14 @@
(require 'calendar)
(defcustom gnosis-algorithm-interval '(1 3)
- "Gnosis initial interval.
+ "Gnosis initial interval for successful reviews.
-Interval by which a new question is displayed or when it's ef is at 1.3.
+First item: First interval,
+Second item: Second interval.
-First item: First interval
-Second item: Second interval."
+Note: gnosis-algorithm-interval is ignored after 10 TOTAL reviews or
+when ef is above > 3.0, which should only be the case for customized
+notes/review sessions."
:group 'gnosis
:type 'list)
@@ -94,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.
@@ -102,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.
@@ -117,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))))))