From 6a83ad48e36404ad502588ac5b9c5c997d09d4c0 Mon Sep 17 00:00:00 2001 From: Eddy Pedroni Date: Thu, 26 Sep 2024 16:44:38 +0200 Subject: Improve scheduler --- flashcards-project/src/flashcards/scheduler_brutal.py | 3 +++ 1 file changed, 3 insertions(+) (limited to 'flashcards-project/src/flashcards') diff --git a/flashcards-project/src/flashcards/scheduler_brutal.py b/flashcards-project/src/flashcards/scheduler_brutal.py index ebbc0ff..f2a00c2 100644 --- a/flashcards-project/src/flashcards/scheduler_brutal.py +++ b/flashcards-project/src/flashcards/scheduler_brutal.py @@ -65,6 +65,9 @@ class SchedulerBrutal(Scheduler): weights = range(10, 10 + HISTORY_DEPTH) cards = [id for id, card in self._cards.items()] + # Shuffle once at the start, that way if all cards have the same score you still get some variety + shuffle(cards) + # First sort by consolidation index cards.sort(key=lambda id: SchedulerBrutal._consolidationIndex(self._state[id], weights)) -- cgit v1.2.3