Limit number of iterations to 100

This commit is contained in:
coolneng 2021-06-21 03:50:14 +02:00
parent e20e16d476
commit c2cc3c716d
Signed by: coolneng
GPG Key ID: 9893DA236405AF57
1 changed files with 13 additions and 2 deletions

View File

@ -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):