summaryrefslogtreecommitdiffstats
path: root/src/scheduler_brutal.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/scheduler_brutal.py')
-rw-r--r--src/scheduler_brutal.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/scheduler_brutal.py b/src/scheduler_brutal.py
index e4e7ee2..a476932 100644
--- a/src/scheduler_brutal.py
+++ b/src/scheduler_brutal.py
@@ -8,7 +8,7 @@ from random import shuffle
HISTORY_DEPTH = 8
class SchedulerBrutal(Scheduler):
- def __init__(self, cards: dict[int, Card], state: dict):
+ def __init__(self, cards: dict[str, Card], state: dict):
self._cards = cards
self._state = {}
@@ -24,13 +24,13 @@ class SchedulerBrutal(Scheduler):
self._state[id] = history
- def practice(self, size: int) -> list[int]:
+ def practice(self, size: int) -> list[str]:
return self._schedule(size)
- def test(self, size: int) -> list[int]:
+ def test(self, size: int) -> list[str]:
return self._schedule(size)
- def update(self, results: dict[int, int]) -> None:
+ def update(self, results: dict[str, int]) -> None:
# Add card result to sliding window, or None if card was not shown
self._state = {id: history[1:] + [results.get(id, None)]
for id, history in self._state.items()}
@@ -51,7 +51,7 @@ class SchedulerBrutal(Scheduler):
def _exposureIndex(history: list) -> float:
return sum([i + 1 for i, h in enumerate(history) if h is not None])
- def _schedule(self, size: int) -> list[int]:
+ def _schedule(self, size: int) -> list[str]:
weights = range(10, 10 + HISTORY_DEPTH)
cards = [id for id, card in self._cards.items()]