def req5(analyzer, inputLP): """Recibe un LP de interés. Retorna una lista de los países (adyacentes) ordenados descendentemente según su distancia. Args: analyzer inputLP (str): Landing Point de interés del usuario. Returns: sorted_list (ARRAY_LIST): Lista ordenada. """ return model.req5(analyzer, inputLP)
def req5(analyzer,lp_name): delta_time = -1.0 delta_memory = -1.0 tracemalloc.start() start_time = getTime() start_memory = getMemory() """ id = mp.get(analyzer["id_dado_lp"], lp_name)["value"] mapa = model.req5(analyzer,id) paises = mp.keySet(mapa) final = lt.newList(datastructure="ARRAY_LIST") i=1 while i <= lt.size(paises): pais = lt.getElement(paises, i) distancia = mp.get(mapa, pais)["value"] lt.addLast(final, (pais,distancia)) i+=1 mrge.sort(final, cmpaux2) """ ide = mp.get(analyzer["id_dado_lp"], lp_name) if ide!=None: mapa = model.req5(analyzer,ide["value"]) paises = mp.keySet(mapa) final = lt.newList(datastructure="ARRAY_LIST") i=1 while i <= lt.size(paises): pais = lt.getElement(paises, i) distancia = mp.get(mapa, pais)["value"] lt.addLast(final, (pais,distancia)) i+=1 mrge.sort(final, cmpaux2) ii = 1 while ii <= lt.size(final): elemento = lt.getElement(final, ii) print("PAÍS: " + str(elemento[0]) + " | DISTANCIA (km): " + str(elemento[1])) ii+=1 print(str(lt.size(final)) + " países afectados.") else: print('No hay información para este landing point.') stop_memory = getMemory() stop_time = getTime() tracemalloc.stop() delta_time = stop_time - start_time delta_memory = deltaMemory(start_memory, stop_memory) return delta_time,delta_memory
def req5(catalog, nombre_landing_point): delta_time = -1.0 delta_memory = -1.0 tracemalloc.start() start_time = getTime() start_memory = getMemory() respuesta = model.req5(catalog, nombre_landing_point) stop_memory = getMemory() stop_time = getTime() tracemalloc.stop() delta_time = stop_time - start_time delta_memory = deltaMemory(start_memory, stop_memory) return respuesta, delta_time, delta_memory
def req5(catalog, lo, hi): ans = None delta_time = -1.0 delta_memory = -1.0 tracemalloc.start() start_time = getTime() start_memory = getMemory() lo = datetime.datetime.strptime(lo, '%H:%M:%S').time() hi = datetime.datetime.strptime(hi, '%H:%M:%S').time() ans = model.req5(catalog, lo, hi) stop_memory = getMemory() stop_time = getTime() tracemalloc.stop() delta_time = stop_time - start_time delta_memory = deltaMemory(start_memory, stop_memory) return ans, delta_time, delta_memory
def req5(catalog, minimo, maximo): """ Función que se encarga de iniciar la ejecución del requerimiento 5 en el model y llevar el resultado al view. """ return model.req5(catalog, minimo, maximo)
def reque5(catalog, dic_genres, min_t, max_t): main = catalog['time_stamps'] ans = model.req5(catalog, main, dic_genres, min_t, max_t) return ans
def req5(analyzer,landingP): return model.req5(analyzer,landingP)
def req5(catalog, minimo, maximo): return model.req5(catalog, minimo, maximo)
def req5(catalog, lpointname): lpoint = lpointID(catalog, lpointname) result = model.req5(catalog, lpoint) return result
def req5(catalog, lp): return model.req5(catalog, lp)
def req5(catalog, lp): md.req5(catalog, lp)
def req5(datos, landingpoint): return model.req5(datos, landingpoint)