diff --git a/binarycpython/utils/population_extensions/evolution_functions.py b/binarycpython/utils/population_extensions/evolution_functions.py index edb4b7a58fe6a4b9bb16455d510b31d1ee59328d..f2ebea5a1544413e135fd9472309280f4ac69873 100644 --- a/binarycpython/utils/population_extensions/evolution_functions.py +++ b/binarycpython/utils/population_extensions/evolution_functions.py @@ -556,7 +556,15 @@ class evolution_functions: # this can be set in the _monte_carlo_sampling_check_mass_threshold function or via _monte_carlo_sampling_check_custom_threshold if self.grid_options["_monte_carlo_threshold_reached"]: # TODO: Write a correct signalling of stopping the queue while - print("_monte_carlo_threshold_reached True. WHAT TO DO NOW??") + + self.verbose_print( + "Monte-Carlo threshold reached. Signaling to stop processing the queue{}", + self.grid_options["verbosity"], + 2, + ) + + # Queue is done: + self.grid_options["_queue_done"] = True ######## # Put system in the job queue @@ -573,6 +581,11 @@ class evolution_functions: 3, ) + ######## + # Handle stopping + if self.grid_options["_queue_done"] == True: + break + # Signal queue is done self.grid_options["_queue_done"] = True