def run_experiment(args, log): data_directory = "../%s/%s" % (args.data_folder, args.topology) topo = create_topology(args, data_directory) # topo.draw() ctrl = create_ctrl(args, topo) ezsegway = EzSegway(ctrl, topo) global_vars.ctrl = ctrl global_vars.switches, global_vars.switch_ids = create_sw(args, topo, ctrl) Simulation.activate(global_vars.ctrl, global_vars.ctrl.run(), at=0.0) Simulation.activate(ezsegway, ezsegway.run(), at=0.0) flow_folder = utils.get_flow_folder(data_directory, args.topology_type, args.generating_method, args.number_of_flows, args.failure_rate) update_time = run_one_test( args, log, ezsegway, flow_folder + "/flows_%d.intra" % args.test_number) with open("../results.dat", "a") as f: res = [ args.method, args.topology, args.generating_method, args.failure_rate, args.number_of_flows, args.test_number, update_time ] res = [str(x) for x in res] f.write(','.join(res) + "\n")
def run_experiment(self, args): data_directory = "../%s/%s" % (args.data_folder, args.topology) self.create_topology_from_adjacency_matrix(data_directory) eventlet.monkey_patch(socket=True, thread=True) global_vars.flow_folder = utils.get_flow_folder(data_directory, args.topology_type, args.generating_method, \ args.number_of_flows, args.failure_rate) # self.log.info("flow folder: %s" % global_vars.flow_folder) self.on_timer() self.run_server()
def parse_args(self, args, log): data_directory = "../%s/%s" % (args.data_folder, args.topology) ez_topo = Ez_Topo() if args.topology_type == constants.TOPO_ROCKETFUEL: topo = ez_topo.create_rocketfuel_topology(data_directory) elif args.topology_type == constants.TOPO_ADJACENCY: topo = ez_topo.create_topology_from_adjacency_matrix(data_directory) elif args.topology_type == constants.TOPO_WEIGHTED_ADJACENCY: topo = ez_topo.create_latency_topology_from_adjacency_matrix(data_directory) else: raise Exception("What topology type") flow_folder = utils.get_flow_folder(data_directory, args.topology_type, args.generating_method, str(args.number_of_flows), str(args.failure_rate)) return topo, flow_folder