Skip to content

Commit

Permalink
approaching heavywatal#15
Browse files Browse the repository at this point in the history
  • Loading branch information
hamazaki1990 committed May 5, 2017
1 parent 33328c8 commit 0b1f391
Showing 1 changed file with 15 additions and 8 deletions.
23 changes: 15 additions & 8 deletions hamazaki1990/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,26 @@


def get_heterogeneity(Population):
for x in Population._inds:
if Population[0] != Population[x]:
Population_ids = [x.get_id() for x in Population._inds]
for x in range(1, len(Population_ids)):
if Population_ids[0] != Population_ids[x]:
return True
break
else:
return False
else:
return False


def simulate_fixwf(Population):
if complete_fixation(Population):

cnt = 1
while get_heterogeneity(Population):
Population = Population.next_genwf()
cnt += 1
print(Population._inds)
else:
print(cnt)


p1 = Population(5)
p1.print_ids
simulate_fixation(p1)
p1.print_ids()
print(get_heterogeneity(p1))
simulate_fixwf(p1)

0 comments on commit 0b1f391

Please sign in to comment.