This commit is contained in:
UmbertoJr 2019-12-13 11:11:21 +01:00
parent 98cc9401a1
commit ddaa40f649

View file

@ -27,6 +27,7 @@ class Simulated_Annealing:
current_len += delta_E current_len += delta_E
if current_len < best_len: if current_len < best_len:
best_sol = current_sol best_sol = current_sol
best_len = current_len
else: else:
r = np.random.uniform(0, 1) r = np.random.uniform(0, 1)
if r < np.exp(- delta_E / temperature): if r < np.exp(- delta_E / temperature):