summaryrefslogtreecommitdiffstats
path: root/src/scheduler_brutal.py
blob: 0c7463fc18e735073cc8b510823c445f00547716 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
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