Skip to content

Commit aa6d9c9

Browse files
Fix: restore function body indentation and fix docstring
1 parent e85a44b commit aa6d9c9

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

searches/simulated_annealing.py

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ def simulated_annealing(
2828
2929
Args:
3030
search_prob: The search state at the start.
31-
find_max: If True, the algorithm should find the minimum else the minimum.
31+
find_max: If True, the algorithm should find the maximum else the minimum.
3232
max_x, min_x, max_y, min_y: the maximum and minimum bounds of x and y.
3333
visualization: If True, a matplotlib graph is displayed.
3434
start_temperate: the initial temperate of the system when the program starts.
@@ -52,6 +52,12 @@ def simulated_annealing(
5252
>>> isinstance(result, SearchProblem)
5353
True
5454
"""
55+
search_end = False
56+
current_state = search_prob
57+
current_temp = start_temperate
58+
scores = []
59+
iterations = 0
60+
best_state = None
5561

5662
while not search_end:
5763
current_score = current_state.score()
@@ -145,3 +151,8 @@ def test_f2(x, y):
145151
"The maximum score for f(x, y) = 3*x^2 - 6*y found via hill climbing: "
146152
f"{local_min.score()}"
147153
)
154+
```
155+
156+
Depois commit com a mensagem:
157+
```
158+
Fix: restore function body indentation and fix docstring

0 commit comments

Comments
 (0)