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
Exemple #2
0
def create_topology(args, data_directory):
    ez_topo = Ez_Topo()
    if args.topology_type == constants.TOPO_ROCKETFUEL:
        return ez_topo.create_rocketfuel_topology(data_directory)
    elif args.topology_type == constants.TOPO_ADJACENCY:
        return ez_topo.create_topology_from_adjacency_matrix(data_directory)