diff --git a/hamazaki1990/main.py b/hamazaki1990/main.py index cb5ad27..3f1d5eb 100644 --- a/hamazaki1990/main.py +++ b/hamazaki1990/main.py @@ -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)