def __init__(self): self.player = 1 # 1 for black and -1 for white self.board = np.zeros(shape=(15, 15), dtype=np.int8) self.history = list() self.features = defaultdict() self.end = False self.violate = False
def __init__(self): """ Initializes state by default configuration """ self.player = 1 # 1 for black and -1 for white self.board = np.zeros(shape=(15, 15), dtype=np.int8) self.history = list() self.features = defaultdict() self.end = False self.violate = False
def copy(self): cloned = State() cloned.player = self.player cloned.board = self.board.copy() cloned.history = list(self.history) cloned.features = defaultdict(self.features) cloned.end = self.end cloned.violate = self.violate return cloned