def test_find_path_3_right(self): print('\nначало') for node in find_path(self.G[3], 'enter_d304', 'enter_i303'): print(node.id) print('конец\n') print('\nначало') for node in find_path(self.G[3], 'enter_j318', 'enter_j300'): print(node.id) print('конец\n')
def get_path(aud): svg_files = [ '../../Data/0этаж.svg', '../../Data/1этаж.svg', '../../Data/2этаж.svg', '../../Data/3этаж.svg' ] graph = get_full_graph(svg_files, [0, 1, 2, 3]) for i in range(len(aud) - 1): if (aud[i] != aud[i + 1]): path = find_path(graph, Auditory.get_new_aud_title(aud[i]), Auditory.get_new_aud_title(aud[i + 1])) else: return None return path
def test_find_path_with_view(self): lines = [] f = open(self.svg_files[3]) for line in f.readlines(): lines.append(line) f.close() nodes_code = '' for node in find_path(self.G[3], 'enter_g303', 'enter_v316'): nodes_code += '<circle\nstyle=\"display:inline;fill:#3333cc;fill-opacity:1;stroke:none;stroke-width:0' \ '.1\"\nr=\"0.4\"\ncy=\"' + str(node.y) + \ '\"\ncx=\"' + str(node.x) + '\"\nid=\"' + node.id + '\" />\n' lines.insert(len(lines) - 2, nodes_code) f = open('path_nodes.svg', 'w') for line in lines: f.write(line) f.close()
def test_find_path_2_3(self): path = find_path(self.full_graph, 'enter_v216', 'enter_v316') print('\nначало') for node in path: print(node.id) print('конец\n')
def test_find_path_2(self): print('\nначало') for node in find_path(self.G[2], 'enter_g203', 'enter_v216'): print(node.id) print('конец\n')
def test_find_path_3(self): print('\nначало') for node in find_path(self.G[3], 'enter_g303', 'enter_v316'): print(node.id) print('конец\n')
def test_find_path_1_3(self): print('\nначало') for node in find_path(self.full_graph, 'enter_v105', 'enter_k311'): print(node.id) print('конец\n')
def test_find_path_1(self): print('\nначало') for node in find_path(self.G[1], 'enter_v105', 'enter_d103'): print(node.id) print('конец\n')
def test_find_path_2_right(self): print('\nначало') for node in find_path(self.G[2], 'enter_d200', 'enter_j219'): print(node.id) print('конец\n')