Skip to content

Commit

Permalink
update formula of simulator
Browse files Browse the repository at this point in the history
  • Loading branch information
L-M-Sherlock committed Oct 20, 2024
1 parent 6c890e8 commit f071027
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/fsrs_optimizer/fsrs_simulator.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,8 +127,12 @@ def init_d_with_short_term(rating):
new_d = init_d(rating) - w[6] * rating_offset
return np.clip(new_d, 1, 10)

def linear_damping(delta_d, old_d):
return delta_d * (10 - old_d) / 9

def next_d(d, rating):
new_d = d - w[6] * (rating - 3)
delta_d = -w[6] * (rating - 3)
new_d = d + linear_damping(delta_d, d)
new_d = mean_reversion(init_d(4), new_d)
return np.clip(new_d, 1, 10)

Expand Down

0 comments on commit f071027

Please sign in to comment.