示例#1
0
        outfile.write(initial_head)

    for ctr in range(arg.number_of_runs):
        if arg.graph_generation == "guyondata":
            G = Datasets.get_guyon_graph(ctr + 1)
        else:
            G = Datasets.get_scale_free_graph_edge(arg.network_size,
                                                   initial_module, nb_modules,
                                                   arg.module_size, arg.prob_p,
                                                   arg.prob_q,
                                                   arg.removed_edges, rng)

        rate_conection = len(G.edges) / len(G.nodes)

        average_shortest_paths = []
        for _, cluster in Datasets.get_groups(G).items():
            nodes = list(cluster)
            average_shortest_paths.append(
                Scores.average_shortest_path(G, nodes))
        result = str(ctr) + "," + str(arg.network_size) + "," + str(
            arg.module_size) + "," + str(rate_conection) + "," + str(
                average_shortest_paths[0])
        # save the network and the simulation transcripts in the file
        network_path, weight_path = write_network_edge_list(
            G, arg.outfile, "sim" + str(ctr + 1))
        truehits = Datasets.get_groups(G)
        th = set([j for i in truehits.values() for j in i])

        # geting the result of others tools (verify set_variables.json file)
        if 'bionet' in data['tools']:
            print("\nExecuting Bionet\n")