Skip to content
Snippets Groups Projects
Commit a9bf52e7 authored by Muller Sacha's avatar Muller Sacha
Browse files

commit before pull

parent a3c91feb
Branches
No related tags found
No related merge requests found
*.pyc *.pyc
\ No newline at end of file __pycache__/
\ No newline at end of file
...@@ -101,4 +101,4 @@ class RotTable: ...@@ -101,4 +101,4 @@ class RotTable:
table1 = RotTable() table1 = RotTable()
print(table1.rot_table) # print(table1.rot_table)
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
...@@ -3,19 +3,22 @@ import math ...@@ -3,19 +3,22 @@ import math
import numpy import numpy
import RotTable import RotTable
from individu import Individu from individu import Individu
from population import Population from population import Population, afficher
import croisement import croisement
from Traj3D import * from Traj3D import *
from random import random from random import random
import matplotlib.pyplot as plt import matplotlib.pyplot as plt
def main(N,tmax,pmutation, proportion,brin="plasmid_8k.fasta"): def main(N,tmax,pmutation, proportion,brin="plasmid_8k.fasta"):
'''lineList = [line.rstrip('\n') for line in open(brin)] '''lineList = [line.rstrip('\n') for line in open(brin)]
brin = ''.join(lineList[1:])''' brin = ''.join(lineList[1:])'''
L=[] L=[]
People=Population(N) People=Population(N)
afficher(People)
for i in range(tmax): for i in range(tmax):
print("\n \n NOUVELLE GENERATION \n \n")
max=0 max=0
best=None best=None
for individu in People.indiv: for individu in People.indiv:
...@@ -29,11 +32,12 @@ def main(N,tmax,pmutation, proportion,brin="plasmid_8k.fasta"): ...@@ -29,11 +32,12 @@ def main(N,tmax,pmutation, proportion,brin="plasmid_8k.fasta"):
best=individu best=individu
max=individu.score max=individu.score
L.append(max) L.append(max)
print(L) # print(L)
afficher(People)
plt.plot([i for i in range(tmax)], L) plt.plot([i for i in range(tmax)], L)
plt.show() plt.show()
return(individu) return(individu)
main(100,50,0.015,2) main(10,3,0.015,2)
...@@ -142,6 +142,7 @@ def afficher(popu): ...@@ -142,6 +142,7 @@ def afficher(popu):
for individu in popu.indiv : for individu in popu.indiv :
print("\n individu \n") print("\n individu \n")
print(individu.table.rot_table) print(individu.table.rot_table)
print ("score", individu.score)
def test(): def test():
popu = Population(4) popu = Population(4)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment