diff --git a/.vscode/settings.json b/.vscode/settings.json index 395ba2d31e295f66eef5e2bd3db334975a462037..31e7ddfdf3472dbdd1b04dd753c498bc2995fd54 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,3 +1,3 @@ { - "python.pythonPath": "D:\\Programmes\\Anaconda3\\python.exe" + "python.pythonPath": "/Users/gauthierroy/anaconda3/bin/python" } \ No newline at end of file diff --git a/__pycache__/RotTable.cpython-36.pyc b/__pycache__/RotTable.cpython-36.pyc index dbb2e4134f6503a6df95598a7c5505e659fc5c85..7a6158dd6374a43aa0874b27bdbf65bcfb4208a1 100644 Binary files a/__pycache__/RotTable.cpython-36.pyc and b/__pycache__/RotTable.cpython-36.pyc differ diff --git a/__pycache__/Traj3D.cpython-36.pyc b/__pycache__/Traj3D.cpython-36.pyc index ecd80201694553fe02c71577fca8c84a37602d91..31651032f232ae34320d1f923ad5b5548331aa50 100644 Binary files a/__pycache__/Traj3D.cpython-36.pyc and b/__pycache__/Traj3D.cpython-36.pyc differ diff --git a/individu.py b/individu.py index d01e39b7818e6f09edc0766db823cb1798909f5b..0b14b4cf7baf06b66c3374a6bae2f16c6fc795ff 100644 --- a/individu.py +++ b/individu.py @@ -11,23 +11,21 @@ class Individu(): def evaluate(self, brin): traj = Traj3D() - traj.compute(brin, self.table) - traj_array = np.array(traj.getTraj()) - first_nucleotide = traj_array[0, 0:3] - last_nucleotide = traj_array[-1, 0:3] - distance = sqrt(sum((first_nucleotide - last_nucleotide) ** 2)) + fisrt_nuc = brin[0] + last_nu = brin[-1] - first_name = brin[0] - last_name = brin[-1] + traj.compute(brin + fisrt_nuc, self.table) + traj_array = np.array(traj.getTraj()) - rot_computed = self.table.Rot_Table[last_name+first_name] - rot_traj = first_nucleotide - last_nucleotide - print(rot_traj) - print(rot_computed) - diff_angle = sum(abs(rot_computed - rot_traj)) + first_nuc_coordonate = traj_array[0, 0:3] + last_nuc_coordonate = traj_array[-2, 0:3] - self.score = 1/(distance + diff_angle) + test = np.linalg.norm(first_nuc_coordonate - last_nuc_coordonate, ord=2) + distance = sqrt(sum((first_nuc_coordonate - last_nuc_coordonate) ** 2)) + diff_ideal_distance = abs(3.38 - distance) + diff_ideal_distance_2 = abs(3.38 - test) + self.score = (1/(diff_ideal_distance ), 1/diff_ideal_distance_2) def mutation(self): @@ -37,4 +35,5 @@ class Individu(): table = RotTable() test = Individu(table) test.evaluate("AAAGGATCTTCTTGAGATCCTTTTTTTCTGCGCGTAATCTGCTGCCAGTAAACGAAAAAACCGCCTGGGGAGGCGGTTTAGTCGAA") +print(table.rot_table) print(test.score)