Limit number of iterations to 100
This commit is contained in:
parent
e20e16d476
commit
c2cc3c716d
15
src/main.py
15
src/main.py
|
@ -10,10 +10,21 @@ from argparse import ArgumentParser
|
||||||
def execute_algorithm(args, n, m, data):
|
def execute_algorithm(args, n, m, data):
|
||||||
if args.algorithm == "genetic":
|
if args.algorithm == "genetic":
|
||||||
return genetic_algorithm(
|
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:
|
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):
|
def get_row_distance(source, destination, data):
|
||||||
|
|
Loading…
Reference in New Issue