SchedulerInterface
in
A spaced-repetition scheduler.
The interface exists so the algorithm is swappable: FSRS-6 ships as the implementation, but the legacy Leitner curve could be wrapped behind this too, and a future SM-2 or per-user-optimised variant slots in without touching the use cases.
Table of Contents
Methods
- retrievability() : float
- Probability of recalling the term right now, in [0, 1].
- review() : SchedulingResult
- Apply a graded review and return the resulting memory state.
Methods
retrievability()
Probability of recalling the term right now, in [0, 1].
public
retrievability(MemoryState|null $state, DateTimeImmutable $now) : float
Returns 0.0 for a term that has never been reviewed.
Parameters
- $state : MemoryState|null
- $now : DateTimeImmutable
Return values
floatreview()
Apply a graded review and return the resulting memory state.
public
review(MemoryState|null $current, Rating $rating, DateTimeImmutable $now) : SchedulingResult
Parameters
- $current : MemoryState|null
-
The term's state, or null if it has never been graded (a first review).
- $rating : Rating
-
The grade the user gave.
- $now : DateTimeImmutable
-
When the review happened.