Example #1
0
 def __init__(self):
     self.board = ChessBoard()
     self.view = ChessView(self)
     self.view.showMsg("Red")
     self.view.draw_board(self.board)
     self.player_is_red = True
     self.ai = AI()
Example #2
0
    def __init__(self, in_ai_count, in_ai_function, in_play_playout, in_delay, in_end_delay, batch_size, search_threads,
                 processor, num_gpus, res_block_nums, human_color = "b"):
        self.human_color = human_color
        self.current_player = "w"
        self.players = {}
        self.players[self.human_color] = "human"
        ai_color = "w" if self.human_color == "b" else "b"
        self.players[ai_color] = "AI"

        ChessGame.board = ChessBoard(self.human_color == 'b')
        self.view = ChessView(self, board=ChessGame.board)
        self.view.showMsg("Loading Models...")    #"Red"    player_color
        self.view.draw_board(self.board)
        ChessGame.game_mode = in_ai_count
        self.ai_function = in_ai_function
        self.play_playout = in_play_playout
        self.delay = in_delay
        self.end_delay = in_end_delay

        self.win_rate = {}
        self.win_rate['w'] = 0.0
        self.win_rate['b'] = 0.0

        self.view.root.update()
        self.cchess_engine = cchess_main(playout=self.play_playout, in_batch_size=batch_size, exploration=False, in_search_threads=search_threads,
                                         processor=processor, num_gpus=num_gpus, res_block_nums=res_block_nums, human_color=human_color)
Example #3
0
    def __init__(self,
                 mode=1,
                 dis=0,
                 showMove=True,
                 showSearch=False,
                 showGUI=True,
                 saveInfo=False):
        self.board = ChessBoard()
        self.Player_Side = False
        self.GameMode = mode
        self.distribution = dis

        self.ai_0 = AI()
        self.ai_1 = AI()

        self.ShowMoveInfo = showMove
        self.ShowSearchInfo = showSearch
        self.ShowGraphUI = showGUI
        self.SaveInfo = saveInfo

        self.view = ChessView(self)
Example #4
0
 def __init__(self):
     self.view = ChessView(self)
     self.view.showMsg("Red")
     self.view.draw_board(self.board)
Example #5
0
 def setSceneAndView(self):
     self.view = ChessView()