-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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 Simulator #3257
Feat/FSRS Simulator #3257
Conversation
This would require using real deck sizes, right? |
I plan to rename |
IMO "number of new cards to add" sounds unintuitive. |
There are three kinds of cards: reviewed cards, new cards which have been created and cards which will be created in the future. Should we ignore the third kind? PS: I recommend continuing this discussion in https://forums.ankiweb.net/ |
"Additional new cards" is unclear, but idk how to make it better. A button to import all of these from a specific deck/preset would be nice. |
I guess a button to apply the simulation config to the deck config is better, because the simulation config's default values are from deck config. After the user tunes the simulation config, they will want to apply it to deck config.
Group N means the N-th simulation result.
Of course, it's still in its original place. |
Maybe CMRR should be moved into the simulator? It will be more accurate that way, since it will use real limits, real deck size, etc. |
No. I want to keep it as simple as possible. Just leave the complexity in simulator.
It has considered the real cards, including cards in reviewing, learning and new stage. "Additional new cards" is the cards user plans to add in the future. |
Some suggestions:
Seems to be a good idea. Some more requests (if you have the time & motivation):
|
1-4: agree on all four. Next suggestions
|
Then, we should at least express the dates in a more readable form (Jan 1, etc. like the add-on?)
Do you mean that you will need to make significant changes to the simulator code to be able to support this? Or do you mean that there is a fundamental problem in supporting this? I assume the former. In that case, we can keep this feature for a future version.
But when using the simulator, the user will want to adjust these values and we don't want the user to change the actual settings and then forget to revert them to their original values. So, I think that the simulator should have its own settings. |
I think it's a localization issue.
It's a fundamental problem. The simulator cannot predict how many reps you will do during learning stage after changing the learning steps. It could only estimate it from the review logs.
OK. I will re-design it. I also plan to move the simulator into a single page. |
@L-M-Sherlock did you want me to review this now, or wait until you've made those changes? |
I recommend you keep it in the deck options for now, with the FSRS options page including a |
The simulator has been included in component. So I guess we can begin to review this PR now.
|
Is this worth it to add tooltips for this now or wait until there's a seperate page? The current wording seems to be confusing so deck-options-esque tooltips might help some of the users. Also the manual, but that's for the future ig. |
Which tooltips do you want the chart to provide? I will support them later. |
I brought it up because "Additional new cards" isn't very obvious to the avergae user. The other options I see probably wouldn't need it. Maybe a single help page for the simulator, then. |
I ran into some issues which I'll cover below, but when I got things working, it seems like a great addition. It also doesn't feel out of place on that page - is moving it to its own separate page something we actually need to do? When I first tried this, I enabled FSRS on a collection and clicked on 'simulate', and I got this:
The weights in the UI are the default 19 (shown in grey). I open a different collection that had FSRS already enabled, and get this when I click simulate:
After I optimized the weights from their defaults and saved, I could then re-open the deck options and run the simulator. Other thoughts:
|
My concern is this part would make the deck option page too complex. But if it's OK, I'm not opposite to leave it here.
I forget to set a fallback to default parameters. I will fix it later.
It's weird. Doesn't the
It requires to add a progress in
I just picked it arbitrarily. We can benchmark it in FSRS-rs. |
They're set to [] in the collection I imported.
For an MVP, just a simple "processing..." or similar that is shown until the operation completes would be fine. |
@L-M-Sherlock on a scale from 0% to 100%, how close are you to finishing the simulator? |
I assumed he's just waiting for me, and I'll be circling back to this soon. |
90%, I guess. I haven't considered the localization (strings for translation). And it's unclear how much work is waiting for me until I have more feedbacks. |
One last bit of feedback - you should make it clear that Simulator reads FSRS parameters, desired retention, and new/review limit settings from the preset. |
How though? In the tooltips? or by showing people "Getting parameters..." "Getting daily limits..." while simulator is working? |
The latter. But I'm not sure how to do it elegantly. |
} | ||
} else { | ||
req.weights.to_vec() | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not important/required for this PR, but a match would be a bit more readable:
diff --git a/rslib/src/scheduler/fsrs/simulator.rs b/rslib/src/scheduler/fsrs/simulator.rs
index b41d98d76..61ea7074e 100644
--- a/rslib/src/scheduler/fsrs/simulator.rs
+++ b/rslib/src/scheduler/fsrs/simulator.rs
@@ -48,18 +48,15 @@ impl Collection {
learn_limit: req.new_limit as usize,
review_limit: req.review_limit as usize,
};
- let parameters = if req.weights.is_empty() {
- DEFAULT_PARAMETERS.to_vec()
- } else if req.weights.len() != 19 {
- if req.weights.len() == 17 {
+ let parameters = match req.weights.len() {
+ 19 => req.weights.to_vec(),
+ 17 => {
let mut parameters = req.weights.to_vec();
parameters.extend_from_slice(&[0.0, 0.0]);
parameters
- } else {
- return Err(AnkiError::FsrsWeightsInvalid);
}
- } else {
- req.weights.to_vec()
+ 0 => DEFAULT_PARAMETERS.to_vec(),
+ _ => return Err(AnkiError::FsrsWeightsInvalid),
};
let (
accumulated_knowledge_acquisition,
That said, I think this check would be better done in the FSRS crate in the future.
This feature is marked as experimental and collapsed by default, so I have no compunctions about merging this in now, and doing some more polish in follow-up PRs. Minor things I noticed/thoughts I had:
But all in all, it looks great. Thanks as always for your contributions everyone. |
@dae Any rough estimate as to when this feature will be realeased in a beta or stable anki version? |
He has said it's very soon in another thread although we don't have a due date yet. |
Preview:
TODO: