Exemplo n.º 1
0
	def __init__(self, resultfile_prefix = "pit_"):
		Simulation.__init__(self, resultfile_prefix)
Exemplo n.º 2
0
    graphs_similarities.append(
        ("Spectral embedding - " + str(clusters) + "clusters",
         "AutoEncoder embedding - " + str(clusters) + "clusters"))
    print(prog_st_ + str(100 * ((clusters + 1) / 5.)) + "%")

#Graphs simulations and performances checks

print(
    info_st_ +
    "Performs simulations on graphs and perfomance checks \n --------------------------------------------------------"
)
print(info_st_ + "Results will be saved to file at the end")
for graph_name in Graphs.keys():
    current_G = Graphs[graph_name][0]
    clusters = Graphs[graph_name][1]
    sim = Simulation(current_G, nodes_activity, nodes_hash, trace_table)
    num_of_nodes = str(len(nx.nodes(current_G)))
    num_of_edges = str(len(nx.edges(current_G)))
    graph_is_connected = nx.is_connected(current_G)
    simulation_avg_hops = 0
    if graph_is_connected:
        simulation_avg_hops = sim.run_avg_dist()

    results = results.append(
        pd.DataFrame([[
            trace_name, graph_name, clusters, simulation_avg_hops,
            num_of_edges, num_of_nodes, graph_is_connected
        ]],
                     columns=results.columns))

results.reset_index(inplace=True, drop=True)