Change scheduling algorithm
John Smith

John Smith commited on 2021-349 21:29:44
Showing 1 changed files, with 2 additions and 1 deletions.


Instead of simply doubling the delay from the previous review,
the scheduler adds an extra delay of up to 40 kiloseconds
(linearly decreasing) to prevent new cards
from being reviewed mere minutes later.
... ...
@@ -8,7 +8,8 @@
8 8
 ]]
9 9
 local function update(prompt, revtime, revsucc)
10 10
     if revsucc then
11
-        prompt.delay = 2 * (revtime - prompt.time)
11
+        local ad = revtime - prompt.time
12
+        prompt.delay = 2 * ad + math.max(40000 - 0.5 * ad, 0)
12 13
         prompt.succ = prompt.succ + 1
13 14
     else
14 15
         prompt.delay = 30
15 16