### Creating a GUI to display the node and the annimations new_GUI = gui.GUI() new_GUI.open_GUI() ### Setting the world into the GUI new_GUI.set_World(new_world) new_GUI.set_Nodes(node_list) for n in node_list : n.sense_In_Range_Nodes() for pu in PU_list: pu.set_PU_Color() util.best_coloring(node_list, PU_list) #v = node_list[0].complete_graph_coloring2(PU_list) count = util.count_channel_reused_PU(node_list, SU_list, PU_list) reste = util.count_coloring_proportion(node_list) print("count", count) print("reste", reste) #print ("rec", v) new_GUI.color_refresh(node_list) print("-----------------------------------")
nodes_list[0].complete_graph_coloring1() total = len(util.get_all_edges(nodes_list)) v = util.count_coloring_proportion(nodes_list) elif algo == 1: nodes_list[0].complete_graph_coloring2() total = len(util.get_all_edges(nodes_list)) v = util.count_coloring_proportion(nodes_list) elif algo == 2: nodes_list[0].complete_graph_coloring3() total = len(util.get_all_edges(nodes_list)) v = util.count_coloring_proportion(nodes_list) else: util.best_coloring(nodes_list) total = len(util.get_all_edges(nodes_list)) v = util.count_coloring_proportion(nodes_list) all_visit.append(((total - v) / total) * 100) print(total) average = sum(all_visit) / number_Simulations f.write(f'{algo} {x} {average}\n') x_value[algo].append(x) y_value[algo].append(average) print(y_value) f.close() for i in range(num_Algo):