# Calculate new traffic on interfaces and display # the new traffic after the failure print('Here is the traffic after the failure:') model1.update_simulation() model1.display_interfaces_traffic() print() # Add a node to the model print("Adding Node('G') to model") new_node = Node('G') model1.add_node(new_node) print() # Display all the nodes without interfaces print("Here are the nodes without any interfaces:", model1.get_orphan_node_objects()) print() # Add a circuit from new_node to node A print("Add a circuit between Node('A') and Node('G')") model1.add_circuit(Node('A'), Node('G'), 'a-to-g', 'g-to-a') print() # Add traffic to the model shortest_paths_B_D = model1.get_shortest_path('B', 'D') print('The shortest paths between nodes B and D are:') for path in shortest_paths_B_D['path']: pprint(path) print() print('These paths both have a cost of', shortest_paths_B_D['cost'])
# Calculate new traffic on interfaces and display # the new traffic after the failure print("Here is the traffic after the failure:") model1.update_simulation() model1.display_interfaces_traffic() print() # Add a node to the model print("Adding Node('G') to model") new_node = Node("G") model1.add_node(new_node) print() # Display all the nodes without interfaces print("Here are the nodes without any interfaces:", model1.get_orphan_node_objects()) print() # Add a circuit from new_node to node A print("Add a circuit between Node('A') and Node('G')") model1.add_circuit(Node("A"), Node("G"), "a-to-g", "g-to-a") print() # Add traffic to the model shortest_paths_B_D = model1.get_shortest_path("B", "D") print("The shortest paths between nodes B and D are:") for path in shortest_paths_B_D["path"]: pprint(path) print() print("These paths both have a cost of", shortest_paths_B_D["cost"])