Skip to content

Commit

Permalink
pref code
Browse files Browse the repository at this point in the history
  • Loading branch information
ishiko732 committed Dec 17, 2024
1 parent a7a9ad5 commit ecbe9e4
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 11 deletions.
14 changes: 8 additions & 6 deletions src/fsrs/impl/basic_scheduler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -186,17 +186,19 @@ export default class BasicScheduler extends AbstractScheduler {
difficulty,
Rating.Again
)
next_again.stability = this.algorithm.next_forget_stability(
difficulty,
stability,
retrievability
)
const nextSMin =
stability /
Math.exp(
this.algorithm.parameters.w[17] * this.algorithm.parameters.w[18]
)
next_again.stability = Math.min(nextSMin, next_again.stability)
next_again.stability = Math.min(
+nextSMin.toFixed(8),
this.algorithm.next_forget_stability(
difficulty,
stability,
retrievability
)
)

next_hard.difficulty = this.algorithm.next_difficulty(
difficulty,
Expand Down
12 changes: 7 additions & 5 deletions src/fsrs/impl/long_term_scheduler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -112,13 +112,15 @@ export default class LongTermScheduler extends AbstractScheduler {
difficulty,
Rating.Again
)
next_again.stability = this.algorithm.next_forget_stability(
difficulty,
next_again.stability = Math.min(
stability,
retrievability
this.algorithm.next_forget_stability(
difficulty,
stability,
retrievability
)
)
next_again.stability = Math.min(stability, next_again.stability)


next_hard.difficulty = this.algorithm.next_difficulty(
difficulty,
Rating.Hard
Expand Down

0 comments on commit ecbe9e4

Please sign in to comment.