Modyfikacja lepszej pracy algorytmu (populacji, proby)
This commit is contained in:
parent
d1325ac00e
commit
d9c18a3a67
@ -8,7 +8,7 @@ def best_route (lista_paczek):
|
||||
problem_fit = mlrose.TSPOpt(length = 5, fitness_fn = koordynaty_paczek, maximize = False)
|
||||
|
||||
# Znalesc najlepsza paczke za pomocy algorytmu genetycznego
|
||||
best_state, best_fitness = mlrose.genetic_alg(problem_fit, mutation_prob = 0.5, max_attempts = 100, random_state = 2)
|
||||
best_state, best_fitness = mlrose.genetic_alg(problem_fit, mutation_prob = 0.2, max_attempts = 200, random_state = 2)
|
||||
|
||||
print('Najlepsza sciezka: ', best_state)
|
||||
return best_state
|
Loading…
Reference in New Issue
Block a user