Changes made to DupHMM:
(1) Fixed Cluster_Next_Generation so that the correct number of individuals were actually being created each generation
(2) Added variables to change population size instead of hardcoding it. Changed population size from 100 to 300, and breeding individuals from 10 to 20
(3) Changed distance calculation algorithm. Instead of using (data_point-cluster_point)**2, it now uses (fabs(data_point-cluster_point)+1)**2. This applies a penalty for each cluster used, thus penalizing and preventing an ever-increasing number of clusters.
(4) Changed algorithm that determines the conditions in which k should stop incrementing. When comparing the dist_sum variable for a k value to k-1's dist_sum, both dist_sum variables are multiplied by the appropriate k value, and from that the log() is found. In short, log(dist_sum*k) is calculated for both k and k-1. If this log value is greater for k than the log value for k-1, k-1 was the optimal number of k clusters because each cluster's summed up distances from their data points failed to decrease for k.
(5) Changed variables that used the phrase 'cluster_set' to 'cluster_group' to avoid confusion with Python's set data type since 'cluster_set' was actually a list data type
(6) Changed 'Consensus reached for k=x in y generations due to identity to previous generation' algorithm so that all 20 top breeding individuals have to be identical, rather than the top 20 individuals being the same as those present in the previous generation but not necessarily all having the same cluster points. While this takes longer to run, it ensures convergance on the most optimal number of clusters