def is_frontier_pair(t_env_variables: EnvVariables, f_env_variables: EnvVariables, epsilon: float, dist: float = None) -> bool: return is_frontier_pair_values(t_env_values=t_env_variables.get_values(), f_env_values=f_env_variables.get_values(), epsilon=epsilon, dist=dist)
def _find_closest_env(possible_envs_dict: Dict, env_to_search: EnvVariables) -> EnvExecDetails: min_distance = np.inf closest_env = None for possible_env in list(itertools.chain(*possible_envs_dict.values())): dist = np.linalg.norm( np.asarray(possible_env.get_env_values()) - np.asarray(env_to_search.get_values())) if dist < min_distance: closest_env = copy.deepcopy(possible_env) min_distance = dist return closest_env
def compute_dist(t_env_variables: EnvVariables, f_env_variables: EnvVariables) -> float: return compute_dist_values(t_env_values=t_env_variables.get_values(), f_env_values=f_env_variables.get_values())