def get_distance_closest_node_route(self, pos, route): distance = [] for node_iter in route: if node_iter in self._map.get_intersection_nodes(): distance.append(sldist(node_iter, pos)) if not distance: return sldist(route[-1], pos) return sorted(distance)[0]
def closest_curve_position(self, current_node): distance_vector = [] for node_iterator in self._map.get_curve_nodes(): distance_vector.append(sldist(node_iterator, current_node)) return sorted(distance_vector)[0]
def _closest_intersection_route_position(self, current_node, route): distance_vector = [] for _ in route: for node_iterator in self._map.get_intersection_nodes(): distance_vector.append(sldist(node_iterator, current_node)) return sorted(distance_vector)[0]