diff --git a/__pycache__/RotTable.cpython-37.pyc b/__pycache__/RotTable.cpython-37.pyc index 0665bddc8d3fe8aeea7fabbae0d2c01f9aaae884..eda825aff2fc67047d02eda36807123f6b5899fc 100644 Binary files a/__pycache__/RotTable.cpython-37.pyc and b/__pycache__/RotTable.cpython-37.pyc differ diff --git a/__pycache__/Traj3D.cpython-37.pyc b/__pycache__/Traj3D.cpython-37.pyc index a2a274a976ce1c2947d34c190976cd65879f2491..27f1de9630c467c4d2341a5f33c68535c5d6a139 100644 Binary files a/__pycache__/Traj3D.cpython-37.pyc and b/__pycache__/Traj3D.cpython-37.pyc differ diff --git a/algogenetique.py b/algogenetique.py index 81da80b77b9edfbb0a7e5a89350883ae4085f9c9..8a1874e03d214a4c3f2f9804b275af26d35d8f5e 100644 --- a/algogenetique.py +++ b/algogenetique.py @@ -32,7 +32,7 @@ def main(N,tmax,pmutation, proportion,brin="plasmid_8k.fasta"): return(best) -main(100,100,0.1,50) +main(100,100,0,50) diff --git a/population.py b/population.py index cc0e22dd45cd36a1ace7f327ff3938f386dc03bf..828caac54389b4296f47305d41e41a990b3b09dd 100644 --- a/population.py +++ b/population.py @@ -3,6 +3,7 @@ from random import * from individu import Individu from RotTable import RotTable from croisement import croisement_un_point, croisement_deux_points +import copy class Population: def __init__(self,n): @@ -13,6 +14,9 @@ class Population: """Fonction qui renvoie une nouvelle instance de population a partir d'une liste d'individus""" self.n = len(liste_individus) self.indiv = liste_individus + for i in range(0,self.n): + self.indiv[i].evaluate("AAAGGATCTTCTTGAGATCCTTTTTTTCTGCGCGTAATCTGCTGCCAGTAAACGAAAAAACCGCCTGGGGAGGCGGTTTAGTCGAA") + return self def selection_p_best(self,p=None): @@ -83,8 +87,6 @@ class Population: newself.append(x) else: newself.append(y) - for i in range(0, len(newself)): - print(newself[i].score) self = self.modifier_population(newself) @@ -161,8 +163,8 @@ class Population: while len(newself)<vieille_taille: m=randrange(0,self.n) t=randrange(0,self.n) - x=newself[m] - y=newself[t] + x=copy.deepcopy(newself[m]) + y=copy.deepcopy(newself[t]) couple_enfant = enfant(x,y) for child in couple_enfant : child.mutation(proba_mutation)