From 0625bfaf0cf46c5d877ace9019b14113c6193263 Mon Sep 17 00:00:00 2001 From: Jarrett Ye Date: Sat, 21 Dec 2024 23:33:46 +0800 Subject: [PATCH] Fix/check review_limit only if is_learn is false (#262) --- Cargo.lock | 2 +- Cargo.toml | 2 +- src/optimal_retention.rs | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 9e4f170..5481a97 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1077,7 +1077,7 @@ dependencies = [ [[package]] name = "fsrs" -version = "1.4.6" +version = "1.4.7" dependencies = [ "burn", "chrono", diff --git a/Cargo.toml b/Cargo.toml index 46af09b..52ce055 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "fsrs" -version = "1.4.6" +version = "1.4.7" authors = ["Open Spaced Repetition"] categories = ["algorithms", "science"] edition = "2021" diff --git a/src/optimal_retention.rs b/src/optimal_retention.rs index 87f430f..20cb6ec 100644 --- a/src/optimal_retention.rs +++ b/src/optimal_retention.rs @@ -238,7 +238,7 @@ pub fn simulate( card_priorities.pop(); continue; } - if (review_cnt_per_day[day_index] + 1 > review_limit) + if (!is_learn && review_cnt_per_day[day_index] + 1 > review_limit) || (is_learn && learn_cnt_per_day[day_index] + 1 > learn_limit) || (cost_per_day[day_index] + fail_cost > max_cost_perday) {