def get_possible_nxt_prms(self, params=None): if params is None: params = self.get_all_params() count = 0 nxt_prms = {} for wk_r, wk_c, wr_r, wr_c, bk_r, bk_c,white_plays in params: board = ChessBoard(wk=King(wk_r, wk_c, Piece.WHITE), wr=Rook(wr_r, wr_c, Piece.WHITE), bk=King(bk_r, bk_c, Piece.BLACK), white_plays=white_plays) if not board.valid: continue nxt_pos = {} for nxt_moves in board.get_possible_moves(): q = 0 if nxt_moves.state == ChessBoard.BLACK_KING_CHECKMATE: q = 100 elif nxt_moves.state == ChessBoard.DRAW: q = -100 nxt_pos[nxt_moves.board_id()] = q nxt_prms[(wk_r,wk_c,wr_r,wr_c,bk_r,bk_c,white_plays)] = nxt_pos count += 1 if count % 1000 == 0: print (count) return nxt_prms