Able to eval

This commit is contained in:
Alexander Munch-Hansen 2018-03-20 21:51:58 +01:00
parent 85ec8d8e4e
commit 20788292a4
2 changed files with 3 additions and 1 deletions

View File

@ -15,6 +15,8 @@ class Eval:
@staticmethod @staticmethod
def make_pubeval_move(board, sym, roll): def make_pubeval_move(board, sym, roll):
legal_moves = Board.calculate_legal_states(board, sym, roll) legal_moves = Board.calculate_legal_states(board, sym, roll)
# print("Board:", board)
# print("Length:",len(board))
moves_and_scores = [ ( board, moves_and_scores = [ ( board,
pubeval.eval(False, Board.board_features_to_pubeval(board, sym))) pubeval.eval(False, Board.board_features_to_pubeval(board, sym)))
for board for board

View File

@ -280,7 +280,7 @@ class Network:
board = Board.initial_state board = Board.initial_state
while Board.outcome(board) is None: while Board.outcome(board) is None:
roll = (random.randrange(1,7), random.randrange(1,7)) roll = (random.randrange(1,7), random.randrange(1,7))
board = (self.p1.make_move(board, self.p1.get_sym(), roll))[0] board = (self.p1.make_move(Board.map_to_tesauro(board), self.p1.get_sym(), roll))[0]
roll = (random.randrange(1,7), random.randrange(1,7)) roll = (random.randrange(1,7), random.randrange(1,7))
board = Board.flip(Eval.make_random_move(Board.flip(board), 1, roll)) board = Board.flip(Eval.make_random_move(Board.flip(board), 1, roll))
sys.stderr.write("\t outcome {}".format(Board.outcome(board)[1])) sys.stderr.write("\t outcome {}".format(Board.outcome(board)[1]))