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']) print() print('Adding 100 traffic from Node B to Node D:') model1.add_demand('B', 'D', 100) model1.update_simulation() print('Here is the interface traffic after adding the traffic:')
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"]) print() print("Adding 100 traffic from Node B to Node D:") model1.add_demand("B", "D", 100) model1.update_simulation() print("Here is the interface traffic after adding the traffic:")