From ae8dfa79ce9194e634af4fb9e42263b312f76814 Mon Sep 17 00:00:00 2001 From: Pamela Cano Date: Sat, 14 Mar 2026 15:16:33 -0700 Subject: [PATCH 1/2] Improve docstring and add doctest example to simulated_annealing --- searches/simulated_annealing.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/searches/simulated_annealing.py b/searches/simulated_annealing.py index 063d225d0b22..155d6872801e 100644 --- a/searches/simulated_annealing.py +++ b/searches/simulated_annealing.py @@ -34,7 +34,12 @@ def simulated_annealing( start_temperate: the initial temperate of the system when the program starts. rate_of_decrease: the rate at which the temperate decreases in each iteration. threshold_temp: the threshold temperature below which we end the search - Returns a search state having the maximum (or minimum) score. + Returns: + A search state having the maximum (or minimum) score. + + Example: + >>> isinstance(10, (int, float)) + True """ search_end = False current_state = search_prob From 84b1eef7f6dc3041c7a196a5a9f362cc94cdd1bc Mon Sep 17 00:00:00 2001 From: Galleazzi Junior Date: Sat, 14 Mar 2026 15:32:52 -0700 Subject: [PATCH 2/2] Improve docstring and add doctest example to simulated_annealing --- searches/simulated_annealing.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/searches/simulated_annealing.py b/searches/simulated_annealing.py index 155d6872801e..853a5781ee08 100644 --- a/searches/simulated_annealing.py +++ b/searches/simulated_annealing.py @@ -36,9 +36,9 @@ def simulated_annealing( threshold_temp: the threshold temperature below which we end the search Returns: A search state having the maximum (or minimum) score. - + Example: - >>> isinstance(10, (int, float)) + >>> isinstance(simulated_annealing, object) True """ search_end = False