Skip to content

Commit c96879f

Browse files
committed
feat: merge PR aimacode#1297
1 parent fe78a0e commit c96879f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

gui/tsp.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,7 @@ def fitness_fn(state):
260260
while True:
261261
population = [mutate(recombine(*select(2, population, fitness_fn)), self.mutation_rate.get())
262262
for _ in range(len(population))]
263-
current_best = np.argmax(population, key=fitness_fn)
263+
current_best = utils.argmax_random_ties(population, key=fitness_fn)
264264
if fitness_fn(current_best) > fitness_fn(all_time_best):
265265
all_time_best = current_best
266266
self.cost.set("Cost = " + str('%0.3f' % (-1 * problem.value(all_time_best))))

0 commit comments

Comments
 (0)