From 0c9ec046a2ea7f07288d2b5034e674b2897750ef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Chlo=C3=A9=20Muller?= <chloe.muller@student-cs.fr> Date: Tue, 28 Jan 2020 13:55:11 +0100 Subject: [PATCH] encore des corrections d'erreurs --- RotTable.py | 32 ++++++++++++++++---------------- individu.py | 1 + population.py | 9 +++------ 3 files changed, 20 insertions(+), 22 deletions(-) diff --git a/RotTable.py b/RotTable.py index ae2a83b..123d72f 100644 --- a/RotTable.py +++ b/RotTable.py @@ -25,22 +25,22 @@ class RotTable: } __CORRESPONDANCE = {\ - "AA": "TT" - "AC": "TG" - "AG": "TC" - "AT": "TA" - "CA": "GT" - "CC": "GG" - "CG": "GC" - "CT": "GA" - "GA": "CT" - "GC": "CG" - "GG": "CC" - "GT": "CA" - "TA": "AT" - "TC": "AG" - "TG": "AC" - "TT": "AA" + "AA": "TT",\ + "AC": "TG",\ + "AG": "TC",\ + "AT": "TA",\ + "CA": "GT",\ + "CC": "GG",\ + "CG": "GC",\ + "CT": "GA",\ + "GA": "CT",\ + "GC": "CG",\ + "GG": "CC",\ + "GT": "CA",\ + "TA": "AT",\ + "TC": "AG",\ + "TG": "AC",\ + "TT": "AA",\ } # get the angles in each axis (x, y, z), considering the deviation diff --git a/individu.py b/individu.py index ba4e595..3231c88 100644 --- a/individu.py +++ b/individu.py @@ -49,6 +49,7 @@ class Individu(): #sur l'axe z il y a un moins table_rotations[doublet2][coord] = - table_rotations[doublet][coord] + # individu1 = Individu(RotTable()) # print(individu1.table.rot_table) # individu1.mutation() diff --git a/population.py b/population.py index 5fe490a..66aa2f0 100644 --- a/population.py +++ b/population.py @@ -2,7 +2,7 @@ import random from random import random, randint, randrange from individu import Individu from RotTable import RotTable -from croisement import * +from croisement import croisement_un_point, croisement_deux_points class Population: def __init__(self,n): @@ -149,14 +149,11 @@ def test(): for individu in popu.indiv : individu.evaluate("AAAGGATCTTCTTGAGATCCTTTTTTTCTGCGCGTAATCTGCTGCCAGTAAACGAAAAAACCGCCTGGGGAGGCGGTTTAGTCGAA") afficher(popu) - # popu.selection_par_rang() - # print("\n SELECTION PAR RANG \n") - # afficher(popu) - popu.reproduction(selection = popu.selection_proportionelle) + popu.reproduction(selection = popu.selection_duel) print("\n REPRODUCTION \n") afficher(popu) -test() +# test() -- GitLab