Skip to content

Commit

Permalink
Sort by stability in advance.py (#408)
Browse files Browse the repository at this point in the history
  • Loading branch information
Expertium authored May 11, 2024
1 parent 5b1ad66 commit db93bc9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions schedule/advance.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,8 @@ def advance(did):
)

# sort by (1 - elapsed_day / scheduled_day)
# = 1-ln(current retention)/ln(requested retention), -interval (ascending)
cards = sorted(cards, key=lambda x: (1 - (1 / x[6] - 1) / (1 / x[5] - 1), -x[2]))
# = 1-ln(current retention)/ln(requested retention), -stability (ascending)
cards = sorted(cards, key=lambda x: (1 - (1 / x[6] - 1) / (1 / x[5] - 1), -x[3]))
safe_cnt = len(
list(filter(lambda x: 1 - (1 / x[6] - 1) / (1 / x[5] - 1) < 0.13, cards))
)
Expand Down

0 comments on commit db93bc9

Please sign in to comment.