Fixed wrongful appending of current player to board rep

This commit is contained in:
Alexander Munch-Hansen 2018-03-28 00:16:50 +02:00
parent 2654006222
commit 785ae6a5be

View File

@ -42,7 +42,7 @@ class Board:
negatives = [x if x < 0 else 0 for x in board] negatives = [x if x < 0 else 0 for x in board]
board.append(15 - sum(positives)) board.append(15 - sum(positives))
board.append(-15 - sum(negatives)) board.append(-15 - sum(negatives))
board += ([1, 0] if np.sign(player) > 0 else [1, 0]) board += ([1, 0] if np.sign(player) > 0 else [0, 1])
return np.array(board).reshape(1,-1) return np.array(board).reshape(1,-1)
@ -67,7 +67,7 @@ class Board:
features.append((board[0] if np.sign(player) < 0 else board[25]) / 2.0) features.append((board[0] if np.sign(player) < 0 else board[25]) / 2.0)
# Calculate how many pieces there must be in the home state and divide it by 15 # Calculate how many pieces there must be in the home state and divide it by 15
features.append((15 - sum) / 15) features.append((15 - sum) / 15)
features += ([1,0] if np.sign(cur_player) > 0 else [1,0]) features += ([1,0] if np.sign(cur_player) > 0 else [0,1])
test = np.array(features).reshape(1,-1) test = np.array(features).reshape(1,-1)
#print("TEST:",test) #print("TEST:",test)
return test return test