-
Notifications
You must be signed in to change notification settings - Fork 7
/
utils.py
56 lines (39 loc) · 1.17 KB
/
utils.py
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
class BriscolaLogger:
class LoggerLevels:
DEBUG = 0
PVP = 1
TRAIN = 2
TEST = 3
def __init__(self, verbosity=3):
self.configure_logger(verbosity)
def configure_logger(self, verbosity):
self.verbosity = verbosity
if self.verbosity > self.LoggerLevels.DEBUG:
self.DEBUG = lambda *args: None
else:
self.DEBUG = print
if self.verbosity > self.LoggerLevels.PVP:
self.PVP = lambda *args: None
else:
self.PVP = print
if self.verbosity > self.LoggerLevels.TRAIN:
self.TRAIN = lambda *args: None
else:
self.TRAIN = print
self.TEST = print
# Enumerations
class CardsEncoding:
HOT_ON_DECK = 'hot_on_deck'
HOT_ON_NUM_SEED = 'hot_on_num_seed'
class CardsOrder:
APPEND = 'append'
REPLACE = 'replace'
VALUE = 'value'
class NetworkTypes:
DQN = 'dqn'
DRQN = 'drqn'
AC = 'actor_critic'
class PlayerState:
HAND_PLAYED_BRISCOLA = 'hand_played_briscola'
HAND_PLAYED_BRISCOLASEED = 'hand_played_briscolaseed'
HAND_PLAYED_BRISCOLA_HISTORY = 'hand_played_briscola_history'