GA_Program_Details.py¶
This class will write the details of the genetic algorithm run.
-
class
Organisms.GA.GA_Program_Details.
GA_Program_Details
(GA_Program, is_new_ga=True)¶ This class is designed to keep track of the process of the genetic algorithm run.
- Parameters
GA_Program (Organisms.GA.GA_Program:) – This is the main genetic algorithm program this class will be writing about
is_new_ga (bool.) – This determines if to write all the details about this genetic algorithm to a file. You only need to do this if the genetic algorithm is just beginning from generation 0. Default: True.
-
close
()¶ This will close the GA_Run_Details text file that is being recorded to.
This is designed to be a private definition
-
create
(is_new_ga)¶ This definition will create a file containing the details of this genetic algorithm on the disk.
- Parameters
is_new_ga (bool.) – This determines if to write all the details about this genetic algorithm to a file. You only need to do this if the genetic algorithm is just beginning from generation 0.
-
end_clock
(generation)¶ Get the end time taken for a generation to run.
- Parameters
generation (int) – The generation that was run.
returns time_taken: The time taken for the generation to run in seconds. rtype time_taken: float
-
ending_details
()¶ This def will write the finishing remarks of the genetic algorithm to GA_Run_Details
-
open
(read_type)¶ This will open the GA_Run_Details text file that is being recorded to.
This is designed to be a private definition
- Parameters
read_type (char) – This is the way to open the file, either read (r), write (w), or append (a).
-
start_clock
()¶ Get the Starting time for this genetic algorithm, which will be used to time each generation.