Beispiel #1
0
def generate_path (p,n,fileName) :
    """Generates 'n' points near point 'p', connects them in a path, and
    writes the path to the given filename."""
    points = generate_points(p,n)
    path = Path(points[0])
    for i in range(1,n) :
        path.extend(points[i])
    createMap(p,path,fileName)
Beispiel #2
0
def draw_cities_path (fileName) :
    """
    Takes the name of a file (.html) and writes to this file the necessary
    information to overlay the cities path on a Google map. The function
    createMap takes a point which is the 'center' of the map, a path to draw,
    and a filename.
    """
    cities_path = Path(indianapolis)
    cities_path.extend(louisville)
    cities_path.extend(cincinnati)
    cities_path.extend(stlouis)
    cities_path.extend(columbus)
    cities_path.extend(bloomington)
    cities_path.extend(chicago)
    createMap(indianapolis,cities_path,fileName)
Beispiel #3
0
def generate_bitonic_path (p,n,fileName) :
    """For testing the bitonic path calculation on 'n' random locations in
    the neighbordhood of 'p'."""
    path = Bitonic(center=p, size=n).tour()
    createMap(p,path,fileName)
Beispiel #4
0
def generate_bitonic_path_cities (fileName) :
    """For testing the bitonic path calculation on the 7 sample cities."""
    path = Bitonic(cities).tour()
    createMap(indianapolis,path,fileName)