Expand description
§Fitts’ Law Spaced Repetition Library
A hybrid cognitive model combining:
- SM-2: Classic spaced repetition algorithm for interval scheduling
- Fitts’ Law: Response time prediction with adaptive calibration
§Key Innovation: Dual Signal Capture
Unlike traditional flashcard systems that only capture rating, this library captures two complementary signals:
| Signal | Type | Source | Purpose |
|---|---|---|---|
| Rating | Subjective | User input | “How well did I recall?” → SM-2 |
| Response Time | Objective | Measured | “How fast did I recall?” → Fitts calibration |
This enables personalized predictions that adapt to each user’s patterns.
§Quick Start
use fitts::{FittsScheduler, CardState, Rating, ReviewInput};
let mut scheduler = FittsScheduler::new();
let card = CardState::default();
// Option 1: Rating only (traditional)
let result = scheduler.review(card.clone(), Rating::Good);
// Option 2: Rating + Response Time (enables calibration)
let input = ReviewInput::new(Rating::Good, 2500); // 2.5 seconds
let result = scheduler.review(card, input);
println!("Next review in {} days", result.card.interval_days);
println!("Predicted RT: {:.1}s", result.predicted_rt);
if let Some(actual) = result.actual_rt {
println!("Actual RT: {:.1}s", actual);
}§Adaptive Calibration
Based on ACT-R (Anderson, 1993) and Pavlik & Anderson (2008):
error = RT_actual - RT_predicted
a_new = a + α × error
b_new = b + α × error × log₂(ID + 1)The model learns each user’s response patterns over time.
§Algorithm Details
§SM-2 Algorithm (Wozniak, 1987)
Intervals: 1 day → 6 days → previous × EF
Rating → Quality mapping:
- Again = quality 1 (failure, reset)
- Hard = quality 3 (success, maintain)
- Good = quality 4 (success, progress)
- Easy = quality 5 (success, accelerate)
§Fitts’ Law Adaptation
Original (1954): RT = a + b × log₂(2D/W)
Memory adaptation:
- Distance = memory decay (time × difficulty)
- Width = accessibility (ease × stability)
Formula: RT = a + b × log₂(distance/accessibility + 1)
Structs§
- Calibration
Result - Result of a calibration step.
- Card
State - Card state for SM-2 scheduling.
- Deck
- A deck of flashcards.
- Deck
Stats - Deck statistics.
- Fitts
Model - Fitts’ Law memory model with adaptive calibration.
- Fitts
Parameters - Fitts model parameters.
- Fitts
Scheduler - SM-2 scheduler with adaptive Fitts’ Law predictions.
- Review
Input - Input for a card review.
- Review
Result - Result of a card review.
- Scheduled
Card - Card scheduled for review with predictions.
- Scheduler
- Main scheduler for managing decks and reviews.
- Scheduler
Config - Scheduler configuration.
Enums§
- Difficulty
Level - Predicted difficulty level based on Fitts’ Law response time.
- Fitts
Error - Errors in Fitts model operations.
- Rating
- User rating for a review (subjective input from user).
- Scheduler
Error - Scheduler errors.