diff options
Diffstat (limited to 'src/scheduler_brutal.py')
-rw-r--r-- | src/scheduler_brutal.py | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/src/scheduler_brutal.py b/src/scheduler_brutal.py new file mode 100644 index 0000000..0c7463f --- /dev/null +++ b/src/scheduler_brutal.py @@ -0,0 +1,33 @@ +""" +""" + +HISTORY_DEPTH = 8 + +class SchedulerBrutal: + def __init__(self, cards: dict, state: dict): + self._cards = cards + self._state = {} + + # Synchronise state with current card collection + for id, card in self._cards.items(): + history = state.get(id, [None] * HISTORY_DEPTH) + + # adjust history if depth has changed + if len(history) > HISTORY_DEPTH: + history = history[-HISTORY_DEPTH:] + elif len(history) < HISTORY_DEPTH: + history = ([None] * (HISTORY_DEPTH - len(history))) + history + + self._state[id] = history + + def practice(self, size: int) -> dict: + pass + + def test(self, size: int) -> dict: + pass + + def update(self, results: dict) -> None: + pass + + def getState(self) -> dict: + return self._state |