def __init__(self, board_size, komi, match_folder, player1, player2, gpu_id): self.player_color = 'black' self.board_size = board_size self.komi = komi self.seed = np.random.rand() self.match_folder = match_folder self.opponent_action = -1 self.p1_name = player1 self.p2_name = player2 self.gpu_id = gpu_id self.env = goSim.GoEnv(player_color=self.player_color, observation_type='image3c', illegal_move_mode="raise", board_size=self.board_size, komi=self.komi) # init board self.obs_t = self.env.reset() # init players # Todo Select which one is the first player self.p1 = Player_1.AlphaGoPlayer(self.obs_t.copy(), self.seed, 1) self.p2 = Player_2.AlphaGoPlayer(self.obs_t.copy(), self.seed, 2) if not os.path.exists(self.match_folder): os.makedirs(self.match_folder)
def __init__(self): self.inner_env = goSim.GoEnv(player_color='black', observation_type='image3c', illegal_move_mode='raise', board_size=BOARD_DIMS[0], komi=KOMI) self.current_color = 1 board = self.inner_env.reset() self.board = board[:2] self.ended = False self.outcome = None