예제 #1
0
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)
예제 #2
0
def run_stats():
    path, params = set_params()
    gc = GraphColorizer(path, params)
    results = gc.run_statistics()
    show_results(results)
예제 #3
0
def generation_stats():
    path, params = set_params()
    gc = GraphColorizer(path, params)
    results = gc.generations_statistics()
    show_results(results)
예제 #4
0
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)))