Exemple #1
0
        'Topology pickle output path (should be relative to top-level repo dir)',
        default='pox/pox/ext/test_topo.pickle')
    parser.add_argument(
        '--figure9',
        help='Output path for Figure 9 (.eps file), defaults to `figure9.eps`',
        default='figure9.eps')
    args = parser.parse_args()

    cleanmn()

    ##### FIGURE 9 #####

    # Generate full graph of randomly connected switches
    print "\nGenerating Figure 9\n===================\n"
    full_topo = generate_topology(n_servers=686,
                                  n_switches=245,
                                  n_ports=14,
                                  debug=args.debug)

    # Calculate the random permutation traffic paths across the graph
    link_paths = []
    link_paths.append(generate_path_counts(full_topo, 'k-shortest', 8, 18))
    link_paths.append(generate_path_counts(full_topo, 'ecmp', 64, 13))
    link_paths.append(generate_path_counts(full_topo, 'ecmp', 8, 10))

    # Summarize measurements and define display options
    cumulative_count_list = [summarize(lps) for lps in link_paths]
    format_options = [{
        'label': '8 Shortest Paths',
        'color': (0.204, 0.216, 0.592),
        'linewidth': 4,
        'solid_capstyle': 'round',
Exemple #2
0
    gs_ci_robots = [None] * N
    # gs_sci_robots = [None] * N

    for n in range(N):
        robots[n] = Robot(_position=initial[2 * n:2 * n + 2])
        gs_ci_robots[n] = GS_CI(n, initial.copy())
        # gs_sci_robots[n] = GS_SCI(n, initial.copy())

    landmarks = [None] * M
    for m in range(M):
        landmarks[m] = sim_env.Landmark(
            m,
            np.matrix(sim_env.landmark_position, dtype=float).getT())

    # N = 5
    topology.generate_topology(N, sim_env.observ_prob, sim_env.comm_prob)

    ### Network Topology
    topo_file = open('topology/output.txt', 'r')

    observ_topology = topology.Topology(N)
    comm_topology = topology.Topology(N)

    edge_num_str = topo_file.readline()

    for i in range(int(edge_num_str)):
        line = topo_file.readline()
        edge = line.split(", ")

        observ_topology.add_edge(int(edge[0]), int(edge[1]))