Fitts Memory Scheduler
A sophisticated memory card review scheduler that applies Fitts' Law to optimize spaced repetition learning. This library provides an intelligent card ordering system based on user response patterns and cognitive difficulty prediction.
What is Fitts Memory Scheduler?
This library implements a memory card review scheduler that uses Fitts' Law principles to:
- Predict Response Times: Estimates cognitive difficulty based on memory strength and accessibility
- Classify Card Difficulty: Automatically categorizes cards from VeryEasy to VeryHard
- Optimize Review Order: Prioritizes cards based on user response patterns and revlog data
- Track Learning Progress: Maintains detailed analytics for continuous optimization
Fitts' Law Applied to Memory
Traditional Fitts' Law (Motor Tasks):
Movement Time = a + b × log₂(Distance/Target_Width + 1)
Our Memory Adaptation:
Response Time = a + b × log₂(Memory_Distance/Memory_Accessibility + 1)
Where:
- Memory Distance = function of time since last review and card difficulty
- Memory Accessibility = function of memory stability and ease factor
- Response Time = predicted cognitive recall time (crescimento exponencial sem limite superior)
Key Features
- 🧠 Intelligent Difficulty Classification: Cards automatically classified into 5 difficulty levels
- ⏱️ Crescimento Exponencial: Response times crescem exponencialmente sem limite superior rígido
- 📊 Revlog-Driven Ordering: Card order based entirely on user response patterns
- 🎯 Priority-Based Scheduling: Smart review order based on urgency × difficulty × error rate
- 📈 Learning Analytics: Detailed performance tracking and optimization recommendations
- 🔄 FSRS Integration: Seamless integration with state-of-the-art spaced repetition algorithms
Core Components
FittsMemoryScheduler
The main scheduler class that handles:
- Card Management: Add, track, and organize memory cards across multiple decks
- Difficulty Classification: Automatically categorize cards based on predicted response times
- Review Scheduling: Generate optimal review order based on user response history
- Session Management: Conduct review sessions with real-time adaptation
- Analytics: Track performance metrics and generate optimization recommendations
Difficulty Levels
Cards are automatically classified based on predicted cognitive response time (exponential growth):
```## Installation
Add this to your `Cargo.toml`:
```toml
fitts = "0.1.0"
Quick Start
use ;
use ;
How It Works: Response-Driven Ordering
The scheduler uses user response patterns to optimize card ordering:
- Initial State: All cards start with similar priority
- User Reviews Cards: Response time and rating are recorded in revlog
- Priority Recalculation: Cards with poor performance get higher priority:
- Slow response times → Higher priority
- Poor ratings (Again/Hard) → Higher priority
- High prediction error → Higher priority
- Reordering: Next session prioritizes problem cards first
Example Priority Calculation
Priority = urgency_factor × difficulty_factor × error_factor × frequency_factor
Where:
- urgency_factor = 1.0 + (days_overdue × urgency_multiplier)
- difficulty_factor = difficulty_level.priority_multiplier()
- error_factor = 1.0 + error_rate (if prioritize_error_prone = true)
- frequency_factor = 1.0 / (reviews_since_update + 1.0)
Examples
See the examples/ directory for complete demonstrations:
memory_simulation_simple.rs- Basic scheduler usageresponse_driven_ordering.rs- How user responses affect card orderingcomprehensive_scheduler_demo.rs- Full feature demonstration
Advanced Features
Analytics and Optimization
// Get user performance statistics
if let Some = scheduler.get_user_stats
// Generate deck optimization recommendations
let optimization = scheduler.generate_deck_optimization?;
println!;
Revlog Analysis
// Export complete review history for analysis
let revlog_json = scheduler.export_revlog;
// Each review creates a detailed revlog entry with:
// - Actual vs predicted response time
// - Rating and difficulty classification
// - Prediction error calculation
// - Context and metadata
Configuration Options
Performance
The scheduler is optimized for real-time use:
- Fast Priority Calculation: O(n) complexity for card ordering
- Efficient Revlog: Minimal memory overhead per review
- Batch Processing: Optimized for multiple card reviews
- Response Time Growth: All predictions follow exponential progression without artificial caps
Integration with FSRS
The scheduler seamlessly integrates with FSRS (Free Spaced Repetition Scheduler):
- Uses FSRS parameters for memory modeling
- Applies Fitts' Law for cognitive difficulty prediction
- Combines both systems for optimal review timing
- Maintains compatibility with FSRS card states
License
This project is licensed under the MIT OR Apache-2.0 license.
Contributing
Contributions are welcome! Please see the examples/ directory for usage patterns and feel free to submit issues or pull requests.