Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat/FSRS-5 #197

Merged
merged 15 commits into from
Jul 14, 2024
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "fsrs"
version = "0.6.4"
version = "1.0.0"
authors = ["Open Spaced Repetition"]
categories = ["algorithms", "science"]
edition = "2021"
Expand Down
4 changes: 2 additions & 2 deletions benches/benchmark.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ pub(crate) fn next_states(inf: &FSRS) -> NextStates {
.unwrap()
}

pub(crate) fn optimal_retention(inf: &FSRS, config: &SimulatorConfig) -> f64 {
pub(crate) fn optimal_retention(inf: &FSRS, config: &SimulatorConfig) -> f32 {
inf.optimal_retention(config, &[], |_v| true).unwrap()
}

Expand Down Expand Up @@ -63,7 +63,7 @@ pub fn criterion_benchmark(c: &mut Criterion) {
let config = SimulatorConfig {
deck_size: 3650,
learn_span: 365,
max_cost_perday: f64::INFINITY,
max_cost_perday: f32::INFINITY,
learn_limit: 10,
loss_aversion: 1.0,
..Default::default()
Expand Down
148 changes: 94 additions & 54 deletions src/batch_shuffle.rs
Original file line number Diff line number Diff line change
Expand Up @@ -280,164 +280,204 @@ mod tests {
[
FSRSItem {
reviews: vec![
FSRSReview {
rating: 1,
delta_t: 0
},
FSRSReview {
rating: 4,
delta_t: 0,
delta_t: 0
},
FSRSReview {
rating: 3,
delta_t: 1,
rating: 4,
delta_t: 0
},
FSRSReview {
rating: 3,
delta_t: 3,
rating: 4,
delta_t: 1
}
]
},
FSRSItem {
reviews: vec![
FSRSReview {
rating: 1,
delta_t: 0,
rating: 4,
delta_t: 0
},
FSRSReview {
rating: 3,
delta_t: 1,
rating: 4,
delta_t: 0
},
FSRSReview {
rating: 4,
delta_t: 1
},
FSRSReview {
rating: 3,
delta_t: 3,
delta_t: 2
}
],
]
},
FSRSItem {
reviews: vec![
FSRSReview {
rating: 1,
delta_t: 0,
rating: 4,
delta_t: 0
},
FSRSReview {
rating: 3,
delta_t: 1,
rating: 4,
delta_t: 0
},
FSRSReview {
rating: 4,
delta_t: 1
},
FSRSReview {
rating: 3,
delta_t: 3,
delta_t: 1
}
],
]
},
FSRSItem {
reviews: vec![
FSRSReview {
rating: 1,
delta_t: 0,
delta_t: 0
},
FSRSReview {
rating: 3,
delta_t: 1,
rating: 4,
delta_t: 0
},
FSRSReview {
rating: 3,
delta_t: 3,
rating: 4,
delta_t: 0
},
FSRSReview {
rating: 4,
delta_t: 1
}
],
]
},
FSRSItem {
reviews: vec![
FSRSReview {
rating: 1,
delta_t: 0,
rating: 4,
delta_t: 0
},
FSRSReview {
rating: 3,
delta_t: 1,
rating: 4,
delta_t: 0
},
FSRSReview {
rating: 4,
delta_t: 1
},
FSRSReview {
rating: 3,
delta_t: 3,
delta_t: 1
}
],
]
},
FSRSItem {
reviews: vec![
FSRSReview {
rating: 1,
delta_t: 0
},
FSRSReview {
rating: 4,
delta_t: 0,
delta_t: 0
},
FSRSReview {
rating: 4,
delta_t: 3,
delta_t: 0
},
FSRSReview {
rating: 3,
delta_t: 10,
rating: 4,
delta_t: 1
}
],
]
},
FSRSItem {
reviews: vec![
FSRSReview {
rating: 4,
delta_t: 0,
delta_t: 0
},
FSRSReview {
rating: 4,
delta_t: 0
},
FSRSReview {
rating: 4,
delta_t: 1,
delta_t: 1
},
FSRSReview {
rating: 3,
delta_t: 4,
delta_t: 3
}
],
]
},
FSRSItem {
reviews: vec![
FSRSReview {
rating: 4,
delta_t: 0,
delta_t: 0
},
FSRSReview {
rating: 4,
delta_t: 0
},
FSRSReview {
rating: 4,
delta_t: 1,
delta_t: 1
},
FSRSReview {
rating: 3,
delta_t: 4,
delta_t: 1
}
],
]
},
FSRSItem {
reviews: vec![
FSRSReview {
rating: 4,
delta_t: 0,
delta_t: 0
},
FSRSReview {
rating: 3,
delta_t: 5,
rating: 4,
delta_t: 0
},
FSRSReview {
rating: 4,
delta_t: 1
},
FSRSReview {
rating: 3,
delta_t: 11,
delta_t: 2
}
],
]
},
FSRSItem {
reviews: vec![
FSRSReview {
rating: 3,
delta_t: 0
},
FSRSReview {
rating: 4,
delta_t: 0,
delta_t: 0
},
FSRSReview {
rating: 3,
delta_t: 1,
rating: 4,
delta_t: 0
},
FSRSReview {
rating: 3,
delta_t: 3,
rating: 4,
delta_t: 1
}
],
},
]
}
]
);
}
Expand Down
Loading
Loading