fulgurate icon indicating copy to clipboard operation
fulgurate copied to clipboard

Bug in SM-2 algorithm?

Open suragch opened this issue 7 years ago • 2 comments

Should it be >= rather than ==. (Otherwise self.repetitions == 0 is not handled.)

if self.repetitions == 1: self.interval = 1

https://github.com/theq629/fulgurate/blob/master/cards.py#L34

suragch avatar Mar 01 '18 09:03 suragch

Should it be >= rather than ==. (Otherwise self.repetitions == 0 is not handled.)

if self.repetitions == 1: self.interval = 1

https://github.com/theq629/fulgurate/blob/master/cards.py#L34

@suragch according to Dr. Piotr Wozniak's article

After each repetition session of a given day repeat again all items that scored below four in the quality assessment. Continue the repetitions until all of these items score at least four.

case self.repetitions == 0 is handled as new card, at line 23. and then, it should be included in new_cards at line 81. if you see line 105-107, you could know the app break only when there's nothing new and nothing to review.

so it is indeed handled.

15921483570 avatar Aug 22 '22 14:08 15921483570

I am trying to get back to maintaining this. I agree with @15921483570 , the algorithm as documented should not change the interval if the repetitions are at zero, and it doesn't matter because of the way the cards are run. However, strictly the code should not be changing the interval at all in this case, so line 36 should be elif self.repetitions > 2.

Given that the package separates the core card update code from run_cards() it's also possible that it should have an option to reset the interval in this case, but on the other hand the calling code could do that if its relevant.

theq629 avatar Dec 31 '22 01:12 theq629