Ejemplo n.º 1
0
def runMain():
    time_start = time.clock()
    path_list = main()
    time_end = time.clock()
    path_length = 0
    for index, path in enumerate(path_list):
        path_list[index] = superSmoothPath(path)
        path_length += len(path) - 1
    print "Path length:", path_length
    print "Calculated in:", int(time_end - time_start), "seconds"
    Visualization.runVisualization(path_list)
    Visualization.run3DVisualisation(path_list, 0)
Ejemplo n.º 2
0
def runTest():
    start = time.clock()
    #path = aStarPathFinder((1, 1, 0), (15, 8, 0))
    path = [(1, 1, 0), (1, 2, 0), (1, 3, 0), (1, 3, 1), (1, 4, 1), (1, 5, 1), (2, 5, 1), (3, 5, 1), (3, 5, 0), (3, 6, 0), (4, 6, 0), (5, 6, 0), (5, 7, 0), (5, 8, 0), (5, 8, 1), (4, 8, 1), (4, 7, 1), (4, 7, 2), (5, 7, 2), (6, 7, 2), (7, 7, 2), (7, 7, 1), (7, 8, 1), (8, 8, 1), (8, 9, 1), (8, 9, 0), (9, 9, 0), (10, 9, 0), (10, 8, 0), (10, 7, 0), (10, 6, 0), (11, 6, 0), (12, 6, 0), (12, 7, 0), (12, 8, 0), (13, 8, 0), (14, 8, 0), (15, 8, 0)]
    end = time.clock()
    print "Path calculate time", end - start
    print "Path length: ", len(path)

    Visualization.run3DVisualisation([path], 0)
    start = time.clock()
    smoother_path = smoothPath(path)
    end = time.clock()
    print "Smooth in:", end - start
    Visualization.run3DVisualisation([smoother_path], 0)
Ejemplo n.º 3
0
def runMain():
    start = time.clock()
    paths = main()
    print "Calculated in:", time.clock() - start
    if paths == []:
        print "Could not finish in given number of iterations"
    else:
        print "Amount of paths", len(paths)
        total_length = 0
        for path in paths:
            total_length += len(path) - 1
        print "Total length:", total_length
        print "Not layed paths", not_layed_paths
        if not_used_chips != []:
            print "Deleted chips:", not_used_chips
        print paths
        Visualization.run3DVisualisation(paths)
        Visualization.runVisualization(paths)
Ejemplo n.º 4
0
    relay_list = [0 for i in netlist]

    path_grid = Grid.createPathGrid()
    grid = Grid.createGrid()
    start_time = time.time()
    comp = layIntersectingPaths()
    intersecting_paths, paths_dict = comp[0], comp[1]
    paths = simulatedAnnealing(intersecting_paths, paths_dict, max_iteration=1800)
    end_time = time.time()
    total_length = calculateWireLenght(paths.values())

    print paths
    print "Total wire length = ", total_length, "Computing time = ", end_time - start_time, " seconds or ", (end_time - start_time)/60, "minutes"

    Visualization.runVisualization(paths.values(), 0)
    Visualization.run3DVisualisation(paths.values(), 0)

    smoothed_paths = []
    for path in paths.values():
        smoothed_paths.append(superSmoothPath(path))

    total_length = calculateWireLenght(smoothed_paths)

    print smoothed_paths
    print "Total wire length = ", total_length, "Computing time = ", end_time - start_time, " seconds or ", (end_time - start_time)/60, "minutes"

    Visualization.runVisualization(smoothed_paths, 0)
    Visualization.run3DVisualisation(smoothed_paths, 0)