Skip to content

Commit 47a3001

Browse files
authored
Fix/consider short term params when clipping post-lapse stability (#728)
1 parent fdb900a commit 47a3001

2 files changed

Lines changed: 8 additions & 6 deletions

File tree

fsrs4anki_scheduler.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// FSRS4Anki v5.2.0 Scheduler Qt6
1+
// FSRS4Anki v5.3.4 Scheduler Qt6
22
set_version();
33
// The latest version will be released on https://github.com/open-spaced-repetition/fsrs4anki/releases/latest
44

@@ -224,10 +224,11 @@ function next_recall_stability(d, s, r, rating) {
224224
easyBonus)).toFixed(2);
225225
}
226226
function next_forget_stability(d, s, r) {
227+
let sMin = s / Math.exp(w[17] * w[18]);
227228
return +Math.min(w[11] *
228229
Math.pow(d, -w[12]) *
229230
(Math.pow(s + 1, w[13]) - 1) *
230-
Math.exp((1 - r) * w[14]), s).toFixed(2);
231+
Math.exp((1 - r) * w[14]), sMin).toFixed(2);
231232
}
232233
function next_short_term_stability(s, rating) {
233234
return +(s * Math.exp(w[17] * (rating - 3 + w[18]))).toFixed(2);
@@ -315,7 +316,7 @@ function is_empty() {
315316
return !customData.again.d | !customData.again.s | !customData.hard.d | !customData.hard.s | !customData.good.d | !customData.good.s | !customData.easy.d | !customData.easy.s;
316317
}
317318
function set_version() {
318-
const version = "v5.2.0";
319+
const version = "v5.3.4";
319320
customData.again.v = version;
320321
customData.hard.v = version;
321322
customData.good.v = version;

fsrs4anki_scheduler_qt5.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// FSRS4Anki v5.2.0 Scheduler Qt5
1+
// FSRS4Anki v5.3.4 Scheduler Qt5
22
set_version();
33
// The latest version will be released on https://github.com/open-spaced-repetition/fsrs4anki/releases/latest
44

@@ -225,7 +225,8 @@ function next_recall_stability(d, s, r, rating) {
225225
return +(s * (1 + Math.exp(w[8]) * (11 - d) * Math.pow(s, -w[9]) * (Math.exp((1 - r) * w[10]) - 1) * hardPenalty * easyBonus)).toFixed(2);
226226
}
227227
function next_forget_stability(d, s, r) {
228-
return +Math.min(w[11] * Math.pow(d, -w[12]) * (Math.pow(s + 1, w[13]) - 1) * Math.exp((1 - r) * w[14]), s).toFixed(2);
228+
let sMin = s / Math.exp(w[17] * w[18]);
229+
return +Math.min(w[11] * Math.pow(d, -w[12]) * (Math.pow(s + 1, w[13]) - 1) * Math.exp((1 - r) * w[14]), sMin).toFixed(2);
229230
}
230231
function next_short_term_stability(s, rating) {
231232
return +(s * Math.exp(w[17] * (rating - 3 + w[18]))).toFixed(2);
@@ -324,7 +325,7 @@ function is_empty() {
324325
return !customData.again.d | !customData.again.s | !customData.hard.d | !customData.hard.s | !customData.good.d | !customData.good.s | !customData.easy.d | !customData.easy.s;
325326
}
326327
function set_version() {
327-
const version = "v5.2.0";
328+
const version = "v5.3.4";
328329
customData.again.v = version;
329330
customData.hard.v = version;
330331
customData.good.v = version;

0 commit comments

Comments
 (0)