hoàn thành tích hợp FSRS

This commit is contained in:
2026-04-26 19:31:29 +07:00
parent a573acedd0
commit 8459801ca9
33 changed files with 997 additions and 185 deletions
+22
View File
@@ -0,0 +1,22 @@
const w = [
0.4025, 1.4612, 3.3458, 15.6922, 5.8483, 1.2081, 1.2946, 0.0014, 1.5478,
0.133, 1.0124, 2.4467, 0.0641, 0.5044, 1.242, 0.2836, 2.8536,
];
const stability = 1.4612;
const difficulty = 7.05; // calculated for hard
const elapsedDays = 0;
const retrievability = Math.pow(0.9, elapsedDays / stability);
console.log("R:", retrievability);
let nextStability = 0;
const quality = 1;
nextDifficulty = Math.min(Math.max(difficulty + w[6], 1), 10);
console.log("D':", nextDifficulty);
nextStability = w[10] * Math.pow(nextDifficulty, -w[11]) * (Math.pow(stability + 1, w[12]) - 1) * Math.exp(w[13] * (1 - retrievability));
console.log("S':", nextStability);
const nextReviewDate = new Date();
nextReviewDate.setMinutes(nextReviewDate.getMinutes() + Math.round(nextStability * 24 * 60));
console.log("Date:", nextReviewDate);