CNA_Fitness_Contribution.py¶
Meow
-
Organisms.GA.Fitness_Operators.CNA_Fitness_Contribution.
get_CNA_fitness_contribution
(cluster, max_similarity, min_minimarity, cna_database, collection_function, cna_fitness_function)¶ Get the fitness, based on the structural diversity as determined by the SCM, for a cluster.
- Parameters
cluster (Organisms.GA.Cluster) – This is the cluster you want to obtain rho_i for.
max_similarity (Not needed to be anything) – The maximum similarity obtained from the population + offspring_pools. THIS IS NOT USED IN THIS METHOD, IS HERE FOR CONSISTANCY.
min_minimarity (Not needed to be anything) – The minimum similarity obtained from the population + offspring_pools. THIS IS NOT USED IN THIS METHOD, IS HERE FOR CONSISTANCY.
cna_database (Organisms.GA.SCM_Scripts.CNA_Database) – This is an in-memory database (not a ASE disk database) that records the similarities between clusters in the population.
cna_fitness_function (__func__) – This is the function that converts the rho similarity into a fitness value.
-
Organisms.GA.Fitness_Operators.CNA_Fitness_Contribution.
get_CNA_fitness_contribution_normalised
(cluster, max_similarity, min_minimarity, cna_database, collection_function, cna_fitness_function)¶ Get the fitness, based on the structural diversity as determined by the SCM, for a cluster. This order parameter is the normalised similarity compared to the similarity of clusters in the population.
- Parameters
cluster (Organisms.GA.Cluster) – This is the cluster you want to obtain rho_i for.
max_similarity (float) – The maximum similarity obtained from the population + offspring_pools
min_minimarity (float) – The minimum similarity obtained from the population + offspring_pools
cna_database (Organisms.GA.SCM_Scripts.CNA_Database) – This is an in-memory database (not a ASE disk database) that records the similarities between clusters in the population.
cna_fitness_function (__func__) – This is the function that converts the rho similarity into a fitness value.
-
Organisms.GA.Fitness_Operators.CNA_Fitness_Contribution.
get_CNA_fitness_parameter
(cluster, cna_database, collection_function)¶ Get the order parameter, based on the CNA, for a cluster.
- Parameters
cluster (Organisms.GA.Cluster) – This is the cluster you want to obtain rho_i for.
cna_database (Organisms.GA.SCM_Scripts.CNA_Database) – This is an in-memory database (not a ASE disk database) that records the similarities between clusters in the population.
cna_fitness_function (__func__) – This is the function that converts the rho similarity into a fitness value.
- Returns
CNA_fitness_value: This is the SRM fitness contribution to be used to obtain the fitness valuee
- Rtypes
float
-
Organisms.GA.Fitness_Operators.CNA_Fitness_Contribution.
get_CNA_fitness_parameter_normalised
(cluster, max_similarity, min_minimarity, cna_database, collection_function)¶ Get the order parameter, based on the CNA, for a cluster. This order parameter is the normalised similarity compared to the similarity of clusters in the population.
- Parameters
cluster (Organisms.GA.Cluster) – This is the cluster you want to obtain rho_i for.
max_similarity (float) – The maximum similarity obtained from the population + offspring_pools
min_minimarity (float) – The minimum similarity obtained from the population + offspring_pools
cna_database (Organisms.GA.SCM_Scripts.CNA_Database) – This is an in-memory database (not a ASE disk database) that records the similarities between clusters in the population.
cna_fitness_function (__func__) – This is the function that converts the rho similarity into a fitness value.
- Returns
CNA_fitness_value: This is the SRM fitness contribution to be used to obtain the fitness valuee
- Rtypes
float
-
Organisms.GA.Fitness_Operators.CNA_Fitness_Contribution.
get_lowest_and_highest_similarities_from_collections
(population, collections, cna_database, collection_function)¶ This method will return the value of the highest and lowest similarities from a list of collections that are inputted into this method. The collections variable is a list of collections, for example [population,offspring] This is a private method.
- Parameters
collections (list of collection objects) – A list of all the collections that you want to compare..
- Returns
the lowest similarity of clusters out of all the inputed collections, the maximum similarity out of all the inputed collections.
- Rtypes
float, float