def board_info_numpy_file_writer(the_dict, output_filenames): """ :param output_filenames: MUST BE LENGTH ONE """ struct_array = board_info_array_from_dict_keys(the_dict.keys()) print("Completed BoardInfo struct creation") for j in range(len(struct_array)): if j % 100000 == 0: print("Generated %d move's so far." % j) set_up_move_array(struct_array[j]) np.save(output_filenames[0], struct_array)
def get_eval_score(board, depth): if board["halfmove_clock"] >= 50 or has_insufficient_material(board): return TIE_RESULT_SCORE set_up_move_array(board) if board['children_left'] == 0: if board['best_value'] == TIE_RESULT_SCORE: return TIE_RESULT_SCORE return LOSS_RESULT_SCORES[depth] if board['turn'] else WIN_RESULT_SCORES[depth] if depth == 0: return eval_fn(board) return None
def jitted_set_up_struct_moves(struct_array): for j in range(len(struct_array)): set_up_move_array(struct_array[j])