for name in node_names: node = model1.get_node_object(name) lat, lon = lat_lon_info[counter] node.lat = lat node.lon = lon counter = counter + 1 print() # create demand objects from list of demands # demand_objects = Demand.create_demand_objects(demands) for demand in demands: model1.add_demand(demand['source'], demand['dest'], demand['traffic']) # find the best path from node A to B best_A_B = model1.get_shortest_path(source, dest) print("The best path from Node A to Node B is:", best_A_B) print() # display the traffic print('Interface traffic with no failures:') model1.update_simulation() model1.display_interfaces_traffic() print() print() # Find the remote interface for Node F, interface F-to-D print("Find the remote interface for Node F, interface F-to-D:") f_to_d = model1.get_interface_object('F-to-D', 'F') remote_int = f_to_d.get_remote_interface(model1) print("Remote interface is", remote_int)
counter = 0 for name in node_names: node = model1.get_node_object(name) lat, lon = lat_lon_info[counter] node.lat = lat node.lon = lon counter = counter + 1 print() # create demand objects from list of demands # demand_objects = Demand.create_demand_objects(demands) for demand in demands: model1.add_demand(demand["source"], demand["dest"], demand["traffic"]) # find the best path from node A to B best_A_B = model1.get_shortest_path(source, dest) print("The best path from Node A to Node B is:", best_A_B) print() # display the traffic print("Interface traffic with no failures:") model1.update_simulation() model1.display_interfaces_traffic() print() print() # Find the remote interface for Node F, interface F-to-D print("Find the remote interface for Node F, interface F-to-D:") f_to_d = model1.get_interface_object("F-to-D", "F") remote_int = f_to_d.get_remote_interface(model1) print("Remote interface is", remote_int)