Skip to content

Commit

Permalink
sagyotyu
Browse files Browse the repository at this point in the history
  • Loading branch information
hamazaki1990 committed May 24, 2017
1 parent f28d314 commit 85c5188
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
1 change: 1 addition & 0 deletions hamazaki1990/.gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
*.csv
shukudai.py
16 changes: 14 additions & 2 deletions hamazaki1990/visualize.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ def calculate_mutantfreq(population):
return mutantfreq


def change_allelewf(population):
def change_allelewf(population, generation):
t = 0
fixprocess = [[t, population.calculate_mutantfreq()]]
for x in range(20):
for x in range(generation):
t += 1
population.next_genwf()
fixprocess.append([t, population.calculate_mutantfreq()])
Expand All @@ -42,6 +42,18 @@ def output_allelechange(filename, population, function):
writer.writerow(fixprocess[x])


p1_1 = Population(10)
print(p1_1.get_ids())
print(p1_1.get_fitnesses())
print(p1_1.is_not_fixed())

for x in range(10):
p1_1.next_genwf()
print(p1_1.get_ids())
p1_1.get_genotypes()
p1_1.list_mutation()
print(p1_1.calculate_mutantfreq())

p1 = Population(10, 0.1, 0.2)
output_allelechange("allelefreqwf.csv", p1, change_allelewf)

Expand Down

0 comments on commit 85c5188

Please sign in to comment.