示例#1
0
def requerimiento3(analyzer, origin, destination):
    delta_time = -1.0
    delta_memory = -1.0

    tracemalloc.start()
    start_time = getTime()
    start_memory = getMemory()

    countries = mp.keySet(analyzer['countrypoints'])
    for key in lt.iterator(countries):
        if origin == key.split(',')[0]:
            vertexa = key
        if destination == key.split(',')[0]:
            vertexb = key
    model.minimumCostPaths(analyzer, vertexa)
    minpath = model.minimumCostPath(analyzer, vertexb)
    model.createMap(analyzer, minpath)

    stop_memory = getMemory()
    stop_time = getTime()
    tracemalloc.stop()

    delta_time = stop_time - start_time
    delta_memory = deltaMemory(start_memory, stop_memory)

    return (minpath, (delta_time, delta_memory))
示例#2
0
def minimumCostPaths(analyzer, initialStation):
    """
    Calcula todos los caminos de costo minimo de initialStation a todas
    las otras estaciones del sistema
    """
    return model.minimumCostPaths(analyzer, initialStation)
示例#3
0
def minimumCostPaths(analyzer, paisA):
    """
    Calcula los caminos de costo mínimo desde la capital del país A a todos los demás vértices.
    """

    return model.minimumCostPaths(analyzer, paisA)
def minimumCostPaths(analyzer, pais_1):
    return model.minimumCostPaths(analyzer, pais_1)
示例#5
0
def minimumCostPaths(analyzer, vertexa):
    """
    Retorna las rutas de costo mínimo desde un punto de conexión
    inicial a todos los demás puntos de conexión
    """
    return model.minimumCostPaths(analyzer, vertexa)