summaryrefslogtreecommitdiff
path: root/gnosis-algorithm.el
diff options
context:
space:
mode:
authorThanos Apollo <[email protected]>2024-01-16 09:57:13 +0200
committerThanos Apollo <[email protected]>2024-01-16 09:57:13 +0200
commit0b76877a49348e211a3ce49147f55a0eb11dea7d (patch)
tree97a3c1e67e1e04529fa1d1142b0fa6d79be67f41 /gnosis-algorithm.el
parent8ca53e1a0e7f1cde295b2aab29893439be07a89a (diff)
parent70b1af5810b8c13afc61508d82163c172bfce047 (diff)
Merge branch 'version-0.1.1' into master
- Fix bug for multiple clozes review - Fix gnosis-review-y-or-n for new inputs - Update gnosis-algorithm implementation - Fix minor bugs on gnosis-algorithm Reviews for all note types should work fine with this version
Diffstat (limited to 'gnosis-algorithm.el')
-rw-r--r--gnosis-algorithm.el14
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))))))