diff --git a/__pycache__/RotTable.cpython-37.pyc b/__pycache__/RotTable.cpython-37.pyc index 0665bddc8d3fe8aeea7fabbae0d2c01f9aaae884..20d277d55079d7a6401199aa6d99042a10aacd32 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..3051667333c64564621cb2fe405f2b8ac037b6bd 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..223dc06393b425bf687b58475ef030f46722f1fe 100644 --- a/algogenetique.py +++ b/algogenetique.py @@ -32,7 +32,8 @@ def main(N,tmax,pmutation, proportion,brin="plasmid_8k.fasta"): return(best) -main(100,100,0.1,50) - - +#main(100,100,0.01,50) +lineList = [line.rstrip('\n') for line in open("plasmid_8k.fasta")] +brin = ''.join(lineList[1:]) +print(brin) \ No newline at end of file diff --git a/individu.py b/individu.py index f243bfaba7e6bb7c22cc5c5eb3949ffbf0302d8f..33b958b4c6cefe6e792e11e54abce70b8d517abf 100644 --- a/individu.py +++ b/individu.py @@ -9,8 +9,10 @@ P1 = 0.015 class Individu(): def __init__(self, table): + lineList = [line.rstrip('\n') for line in open("plasmid_8k.fasta")] + brin = ''.join(lineList[1:]) self.table = table - self.score = self.evaluate("AAAGGATCTTCTTGAGATCCTTTTTTTCTGCGCGTAATCTGCTGCCAGTAAACGAAAAAACCGCCTGGGGAGGCGGTTTAGTCGAA") + self.score = self.evaluate(brin) def evaluate(self, brin): traj = Traj3D() @@ -39,7 +41,7 @@ class Individu(): self.score = 1/max(list_distance) - return 1/distance + return 1/max(list_distance) def mutation(self, proba = P1): diff --git a/population.py b/population.py index 559bebbe83e60dab6a55747e9a11f189d99dae0d..3e78cc9abd6794c5e926e9ff50c58845a5f48241 100644 --- a/population.py +++ b/population.py @@ -162,8 +162,10 @@ class Population: y=newself[t] couple_enfant = enfant(x,y) for child in couple_enfant : + lineList = [line.rstrip('\n') for line in open("plasmid_8k.fasta")] + brin = ''.join(lineList[1:]) child.mutation(proba_mutation) - child.evaluate("AAAGGATCTTCTTGAGATCCTTTTTTTCTGCGCGTAATCTGCTGCCAGTAAACGAAAAAACCGCCTGGGGAGGCGGTTTAGTCGAA") + child.evaluate(brin) newself.append(couple_enfant[0]) newself.append(couple_enfant[1]) self = self.modifier_population(newself)