GA_Initiate.py

This class is designed

Organisms.GA.GA_Initiate.GA_Initiate(self)

This definition provides the details to how to run the genetic algorithm. The program has the ability to restart if required.

Organisms.GA.GA_Initiate.Initate_New_GAProgram(self)

Set up the Organisms program to perform a new genetic algorithm run.

returns: the name of the last cluster that was created. rtype: int

Organisms.GA.GA_Initiate.Initial_ProgramChecking(self)

This definition will check data from files and from that obtained self.get_resume_from_generation() and check to whether the program can continue or not.

Organisms.GA.GA_Initiate.Resume_GAProgram(self, resume_from_generation, clusters_in_resumed_population, clusters_in_resumed_population_energies)

This definition initalises all python variables and rewrites and modifies all files to the point when the generation self.resume_from_generation finished and the next generation began.

Parameters:
  • resume_from_generation (int) – the generation the genetic algorithm is resuming from.

  • clusters_in_resumed_population (list of int) – list of the name of the clusters in the population to resume from.

  • clusters_in_resumed_population_energies (list of float) – list of the name of the clusters in the population to resume from

returns: the name of the last cluster that was created. rtype: int

Organisms.GA.GA_Initiate.add_metadata(self)

This is included as this seems to not be added to the collections database when it is first created. Fixing an issue with ASE.

Organisms.GA.GA_Initiate.get_resume_from_generation(self)

Will determine what the clusters in the population are, and the current generation, if the Organisms program is being restarted or if the number of generations is being increased.

Will get this information for files in the Population folder.

Returns:

current_generation: The current generation that the Organisms program is being restarted from, or otherwise None if this is a new Organisms program run.

Return type:

int or None

Returns:

clusters: The clusters in the population. In the formation of [(name of cluster, energy of cluster)]

Return type:

[(int, float), …]