fitts 0.2.1

Spaced repetition scheduler using Fitts' Law for difficulty prediction and SM-2 for interval scheduling.
Documentation
//! # 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
//!
//! ```rust
//! 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):
//!
//! ```text
//! 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)

mod fitts;
mod integration;
mod scheduler;

// Re-export main types
pub use fitts::{CalibrationResult, FittsError, FittsModel, FittsParameters};
pub use integration::{CardState, FittsScheduler, Rating, ReviewInput, ReviewResult};
pub use scheduler::{
    Deck, DeckStats, DifficultyLevel, ScheduledCard, Scheduler, SchedulerConfig, SchedulerError,
};