diff options
Diffstat (limited to 'src/scheduler_brutal.py')
-rw-r--r-- | src/scheduler_brutal.py | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/scheduler_brutal.py b/src/scheduler_brutal.py index 0c7463f..d1c98b5 100644 --- a/src/scheduler_brutal.py +++ b/src/scheduler_brutal.py @@ -1,10 +1,12 @@ """ """ +from card import Card + HISTORY_DEPTH = 8 class SchedulerBrutal: - def __init__(self, cards: dict, state: dict): + def __init__(self, cards: dict[int, Card], state: dict): self._cards = cards self._state = {} @@ -26,8 +28,10 @@ class SchedulerBrutal: def test(self, size: int) -> dict: pass - def update(self, results: dict) -> None: - pass + def update(self, results: dict[int, 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()} def getState(self) -> dict: return self._state |