Documentation

MemoryState
in package

FinalYes

A term's FSRS memory state: the whole of what the scheduler needs to decide when the term is next due.

Immutable — a review produces a new instance rather than mutating this one, which keeps SchedulerInterface implementations pure and trivially testable against the reference vectors.

Table of Contents

Properties

$difficulty  : float
$due  : DateTimeImmutable
$lapses  : int
$lastReview  : DateTimeImmutable|null
$reps  : int
$stability  : float
$state  : SchedulingState

Methods

__construct()  : mixed
elapsedDays()  : int
Whole days elapsed since the last review, floored at 0.
isDue()  : bool
Whether this term is due for review at the given moment.

Properties

$lastReview read-only

public DateTimeImmutable|null $lastReview = null

Methods

__construct()

public __construct(float $stability, float $difficulty, DateTimeImmutable $due[, DateTimeImmutable|null $lastReview = null ][, int $reps = 0 ][, int $lapses = 0 ][, SchedulingState $state = SchedulingState::New ]) : mixed
Parameters
$stability : float
$difficulty : float
$due : DateTimeImmutable
$lastReview : DateTimeImmutable|null = null
$reps : int = 0
$lapses : int = 0
$state : SchedulingState = SchedulingState::New

elapsedDays()

Whole days elapsed since the last review, floored at 0.

public elapsedDays(DateTimeImmutable $now) : int

FSRS works in whole days; a same-day repeat yields 0, which is what routes the update through the short-term stability formula.

Parameters
$now : DateTimeImmutable
Return values
int

isDue()

Whether this term is due for review at the given moment.

public isDue(DateTimeImmutable $now) : bool
Parameters
$now : DateTimeImmutable
Return values
bool
On this page

Search results