-
-
Notifications
You must be signed in to change notification settings - Fork 25
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
[Question] why the seed includes review_time.getTime()? #131
Comments
Yes, when the To maintain the same interval within the same day, you can use |
The fuzz seed implemented in Anki is generated from card id and the number of reviews of the card. The seed will not change if the user doesn't review it. It's a good design because the fuzz factor will not change over time. fn get_fuzz_seed_for_id_and_reps(card_id: CardId, card_reps: u32) -> Option<u64> {
if *crate::PYTHON_UNIT_TESTS || cfg!(test) {
None
} else {
Some((card_id.0 as u64).wrapping_add(card_reps as u64))
}
} The current implementation of fuzz seed in ts-fsrs can cause a weird case: the interval may decrease over time. For example, if the original interval is 100 days, and the fuzz factor is 1 in the first day, the fuzzed interval would be ~110 days. If I don't review it and delay the review to the next day, based DSR model, the original interval will increase to ~105 days. But the fuzz factor may decrease to 0, then the fuzzed interval would be ~95 days. |
Since the |
Removing |
How about directly exposing |
personally i think a card has an id is reasonable. why this solution not work for ts-fsrs? |
For related details, please see: open-spaced-repetition/go-fsrs#3 (comment) |
i got it, thank you. |
Plan to use the proxy design pattern to implement this feature, which allows developers to use |
oh, i didn't realize there is |
I plan to write the // Generates a seed strategy function for card IDs.
export function GenSeedStrategyWithCardId(card_id_field: string): TSeedStrategy {
return function (this: AbstractScheduler): string {
// https://github.com/open-spaced-repetition/ts-fsrs/issues/131#issuecomment-2408426225
const card_id = Reflect.get(this.current, card_id_field) ?? 0
const reps = this.current.reps
// ex1
// card_id:string + reps:number = 'e2ecb1f7-8d15-420b-bec4-c7212ad2e5dc' + 4
// = 'e2ecb1f7-8d15-420b-bec4-c7212ad2e5dc4'
// ex2
// card_id:number + reps:number = 1732452519198 + 4
// = '17324525191984'
return String(card_id + reps || 0)
}
}
function main() {
const seedStrategy = GenSeedStrategyWithCardId('card_id')
const f = fsrs().useStrategy(StrategyMode.SEED, seedStrategy)
const card = createEmptyCard<Card & { card_id: number }>()
card.card_id = 555
const record = f.repeat(card, new Date())
for (const item of record) {
console.log(item)
}
} |
To quickly migrate to using the |
ts-fsrs/src/fsrs/abstract_scheduler.ts
Lines 91 to 96 in aaa1543
Does it mean I will get different interval if I review the same card in the same date?
The text was updated successfully, but these errors were encountered: