def _vis_graph(graph, points, worker, status):
total_points = len(points)
visible_edges = []
if status:
t0 = default_timer()
points_done = 0
for p1 in points:
for p2 in visible_vertices(p1, graph, scan='half'):
visible_edges.append(Edge(p1, p2))
if status:
points_done += 1
avg_time = round((default_timer() - t0) / points_done, 3)
time_stat = (points_done, total_points-points_done, avg_time)
status = '\r\033[' + str(21*worker) + 'C[{:4}][{:4}][{:5.3f}] \r'
stdout.write(status.format(*time_stat))
stdout.flush()
return visible_edges
评论列表
文章目录