def setUp(self):
     parser = Parser("../test_data", "euro16_k2.txt")
     scenario = parser.get_scenario(2)
     graph = graph_factory(scenario.networkTopology)
     candidatePathFetcher = CandidatePathsFetcher(scenario.candidatePaths, len(graph.nodes), scenario.pathsLengths)
     # get path
     list_of_paths1 = candidatePathFetcher.fetch_candidates(0, 1)
     # 1, 6, 10
     self.path = list_of_paths1[1]
     self.edges = graph.edges
     self.sa = SpectrumAllocator(graph)
示例#2
0
            edge.spectrum.clear()


if __name__ == "__main__":
    from parser.parser import Parser
    from graph.graph import graph_factory
    from graph.path import CandidatePathsFetcher

    # initialize
    logging.basicConfig(level=logging.DEBUG)
    test_parser = Parser('../test/test_data', 'euro16_k2.txt')
    scenario = test_parser.get_scenario(2)
    graph = graph_factory(scenario.networkTopology)

    candidatePathFetcher = CandidatePathsFetcher(scenario.candidatePaths,
                                                 len(graph.nodes),
                                                 scenario.pathsLengths)

    # get paths
    list_of_paths1 = candidatePathFetcher.fetch_candidates(0, 1)
    list_of_paths2 = candidatePathFetcher.fetch_candidates(0, 2)
    path1 = list_of_paths1[0]
    path2 = list_of_paths1[1]
    path3 = list_of_paths2[0]
    path4 = list_of_paths2[1]
    paths = [path1, path2, path3, path4]
    for path in paths:
        print path.edges

    # allocate
    sa = SpectrumAllocator(graph)