You can create an FSRS instance using default parameters (optimized for average learning habits) or by providing a custom set of parameters.
To use default parameters:
use fsrs::FSRS;
let fsrs = FSRS::default();
To use custom parameters, pass a slice of f32 to FSRS::new(). The length of the slice determines how the parameters are interpreted (e.g., 0, 17, 19, or 21 elements). If the slice is empty, it defaults to the standard 21 parameters.
use fsrs::FSRS;
let custom_params = [
0.212, 1.2931, 2.3065, 8.2956, 6.4133, 0.8334, 3.0194,
0.001, 1.8722, 0.1666, 0.796, 1.4835, 0.0614, 0.2629,
1.6483, 0.6014, 1.8729, 0.5425, 0.0912, 0.0658, 0.1542
];
let fsrs = FSRS::new(&custom_params).expect("Custom parameters should be valid");
use fsrs::FSRS;
let fsrs = FSRS::default();
let custom_params = [
0.212, 1.2931, 2.3065, 8.2956, 6.4133, 0.8334, 3.0194,
0.001, 1.8722, 0.1666, 0.796, 1.4835, 0.0614, 0.2629,
1.6483, 0.6014, 1.8729, 0.5425, 0.0912, 0.0658, 0.1542
];
let fsrs = FSRS::new(&custom_params).expect("Custom parameters should be valid");