GA_Setup.py

This class is designed

Organisms.GA.GA_Setup.GA_Setup(self, cluster_makeup, pop_size, generations, no_offspring_per_generation, creating_offspring_mode, crossover_type, mutation_types, chance_of_mutation, r_ij, vacuum_to_add_length, Minimisation_Function, surface_details, epoch_settings, cell_length, memory_operator_information, predation_information, fitness_information, ga_recording_information, force_replace_pop_clusters_with_offspring, user_initialised_population_folder, rounding_criteria, print_details, no_of_cpus, finish_algorithm_if_found_cluster_energy, total_length_of_running_time)

This method will set up the genetic algorithm.

Parameters:
  • cluster_makeup ({str: int, ...}) – This contains the information on the makeup of the cluster you would like to optimise for. Format is a dictionary in the form of: {element: number of that element}

  • pop_size (int) – The size of the population

  • generations (int) – The number of generations that are run

  • no_offspring_per_generation (int) – The number of offspring that are created per generation

  • creating_offspring_mode (str.) – This indicates how the offspring are created, either via the mating method ‘followed’ by the mutation method, or by only perform the mating method ‘or’ mutation method, or (i.e. either mating and/or mutation). See manual for how to set this.

  • crossover_type (str.) – This is the type of crossover that you would like to use. See the manual for more information.

  • mutation_types (list of (str., float)) – This is a list that contains all the information about the mutation methods you would like to use.

  • chance_of_mutation (float) – This indicates the change of a mutation occuring. See the manual on specifically how this works.

  • r_ij (float) – This is the maximum bond distance that we would expect in this cluster. See the manual for more information.

  • vacuum_to_add_length (float) – This is the amount of vacuum to place around the cluster.

  • Minimisation_Function (__func__) – This is a function that determines how to locally minimise clusters. See manual for more information.

  • surface_details (None) – This functionality has not been designed yet. Default: None

  • epoch_settings (dict.) – This is designed to hold the information about the epoch method.

  • cell_length (float) – This is the length of the cubic unit cell to construct clusters in. See manual for more information. Default: ‘default’

  • predation_information (dict.) – This holds all the information about the predation operator. Default: {‘Predation Operator’:”Off”}

  • fitness_information (dict.) – This holds all the information about the fitness operator. Default: {‘Fitness Operator’:”Off”}

  • ga_recording_information (dict.) – Default: {}

  • force_replace_pop_clusters_with_offspring (bool.) – This will tell the genetic algorithm whether to swap clusters in the populatino with offspring if the predation operator indicates they are the same but the predation operator has a better fitness value than the cluster in the population.

  • user_initialised_population_folder (str. or None) – This is the directory to a folder containing any custom made clusters you would like to include in the initial population. Set this to None if you do not have any initial clusters to add into the population. Default: None

  • rounding_criteria (int) – The number of decimal places to round the energies of clusters made during the genetic algorithm to. Default: 2

  • print_details (bool.) – Verbose for this algorithm.

  • no_of_cpus (int) – The number of cpus that the algorithm can use via multiprocessing. Default: 1

  • finish_algorithm_if_found_cluster_energy (dict. or None) – If desired, the algorithm can finish if the LES is located. This is useful to use for methods testing. The algorithm will determine that the LES is found when the genetic algorithm locates the energy of the LES. Read the manual on how to use this. Default: None

  • total_length_of_running_time (int or None) – The total amount of time to run the genetic algorithm for. If the algorithm is still running after this time, the algorithm will safety finish. Time given in hours. None means no limit on time, Default: None.