blob: c40c687d3b71ff651e5fdf39d6ae6cf79f5df436 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
|
"""Decision algorithm factory."""
from enum import Enum, auto as enumAuto
from imago.engine.monteCarlo import MCTS
class DecisionAlgorithms(Enum):
RANDOM = enumAuto()
MONTECARLO = enumAuto()
KERAS = enumAuto()
class DecisionAlgorithmFactory:
def create(self, algorithm, move):
"""Creates an instance of the requested algorithm."""
# if algorithm == DecisionAlgorithms.RANDOM:
# --
if algorithm == DecisionAlgorithms.MONTECARLO:
return MCTS(move)
# if algorithm == DecisionAlgorithms.KERAS:
# --
|