Skip to content

Commit ae8dfa7

Browse files
Pamela CanoPamela Cano
authored andcommitted
Improve docstring and add doctest example to simulated_annealing
1 parent 68473af commit ae8dfa7

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

searches/simulated_annealing.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,12 @@ def simulated_annealing(
3434
start_temperate: the initial temperate of the system when the program starts.
3535
rate_of_decrease: the rate at which the temperate decreases in each iteration.
3636
threshold_temp: the threshold temperature below which we end the search
37-
Returns a search state having the maximum (or minimum) score.
37+
Returns:
38+
A search state having the maximum (or minimum) score.
39+
40+
Example:
41+
>>> isinstance(10, (int, float))
42+
True
3843
"""
3944
search_end = False
4045
current_state = search_prob

0 commit comments

Comments
 (0)