From c2cc3c716dd127a87f39422b579de1bad050a7d8 Mon Sep 17 00:00:00 2001 From: coolneng Date: Mon, 21 Jun 2021 03:50:14 +0200 Subject: [PATCH] Limit number of iterations to 100 --- src/main.py | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/src/main.py b/src/main.py index 035d552..6d9af05 100755 --- a/src/main.py +++ b/src/main.py @@ -10,10 +10,21 @@ from argparse import ArgumentParser def execute_algorithm(args, n, m, data): if args.algorithm == "genetic": return genetic_algorithm( - n, m, data, select_mode=args.selection, crossover_mode=args.crossover + n, + m, + data, + select_mode=args.selection, + crossover_mode=args.crossover, + max_iterations=100, ) else: - return memetic_algorithm(n, m, data, hybridation=args.hybridation) + return memetic_algorithm( + n, + m, + data, + hybridation=args.hybridation, + max_iterations=100, + ) def get_row_distance(source, destination, data):