File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -247,7 +247,7 @@ def hill_climbing(problem):
247
247
stopping when no neighbor is better. [Fig. 4.11]"""
248
248
current = Node (problem .initial )
249
249
while True :
250
- neighbor = argmax (expand (node , problem ), Node .value )
250
+ neighbor = argmax (current . expand (problem ), Node .value )
251
251
if neighbor .value () <= current .value ():
252
252
return current .state
253
253
current = neighbor
@@ -263,7 +263,7 @@ def simulated_annealing(problem, schedule=exp_schedule()):
263
263
T = schedule (t )
264
264
if T == 0 :
265
265
return current
266
- next = random .choice (expand (node . problem ))
266
+ next = random .choice (current . expand (problem ))
267
267
delta_e = next .path_cost - current .path_cost
268
268
if delta_e > 0 or probability (math .exp (delta_e / T )):
269
269
current = next
You can’t perform that action at this time.
0 commit comments