Timer.py¶
This class is designed
-
class
Organisms.GA.Timer.
Timer
(total_length_of_running_time)¶ This class is designed to time the genetic algorithm, as well as to determine if the algorithm has run for longer than is desired by the total_length_of_running_time variable.
- Parameters
total_length_of_running_time (float) – This is the length of time to run the algorithm for before safely finishing the algorithm. The time is given in hours
-
get_time_now
()¶ Returns the current date and time.
-
get_total_length_of_running_time
()¶ Return the maximum amount of time to run the genetic algorithm for, in hours.
- Returns
total_length_of_running_time, the maximum amount of time to run the genetic algorithm for, in hours.
- Return type
float or str.
-
has_elapsed_time
()¶ This determines if the cluster has exceeded the desired running time.
-
print_elapsed_time
()¶ Returns the current running time of the algorithm