Beispiel #1
0
def save_game_data(model_name, game_data):
    winner = game_data['winner']
    game_n = get_game_n(model_name)
    for move_data in game_data['moves']:
        save_file(model_name, game_n, move_data, winner)
    if conf['SGF_ENABLED']:
        save_game_sgf(model_name, game_n, game_data)
Beispiel #2
0
    def test_save_sgf(self):
        model = DummyModel()
        mcts_simulations = 8 # mcts batch size is 8 and we need at least one batch
        game_data = play_game(model, model, mcts_simulations, conf['STOP_EXPLORATION'], self_play=True, num_moves=100)


        os.makedirs("games/test_model")
        save_game_sgf("test_model", 1, game_data)

        os.remove("games/test_model/game_001.sgf")
        os.removedirs("games/test_model")