def run(): path, params = set_params() gc = GraphColorizer(path, params) results = gc.colorize() colors = [result[1] for result in results] result = 'Min: {:.2f}, max: {:.2f}, avg: {:.2f}'.format( min(colors), max(colors), sum(colors) / len(colors)) results_label = ttk.Label(win, text=result) results_label.grid(column=2, row=1)
def run_stats(): path, params = set_params() gc = GraphColorizer(path, params) results = gc.run_statistics() show_results(results)
def generation_stats(): path, params = set_params() gc = GraphColorizer(path, params) results = gc.generations_statistics() show_results(results)
from graph_colorizer import GraphColorizer if __name__ == '__main__': path = 'files/GEOM30b.col' params = { 'N': 10, 'T': 100, 'population_size': 100, 'mutation_probability': 0.05, 'crossover_probability': 0.8, 'max_no_improvements': 100, } gc = GraphColorizer(path, params) results = gc.run() colors = [result[1] for result in results] print('Min: {}, max: {}, średnia: {}'.format(min(colors), max(colors), sum(colors) / len(colors)))