Open PatWright opened 6 years ago
def outputPop(pop):
with open(f'{pop.dvars().gen}.txt', 'w') as output:
...
ops = [PyOperator(func=outputPop) ...]
with ind.sex()
etc added after this line.
ind.sex()
to utils.py. The model will run but I don't get any info on age or sex.def outputPop(pop):
with open(f'{pop.dvars().gen}.txt', 'w') as output:
'age', 'sex'
ops = [PyOperator(func=outputPop) 'age','sex']
preOps=[
migr,
sim.InfoExec('age += 1'),
],
sim.MapSelector(loci='age', fitness={'age < 3':0.3, '3 <= age < 9':0.85, '9<= age < 17':0.6}),
...
...
Thanks!
I meant for you to understand the export function, copy the entire function over there and make the change to the line I point out. I will do it in a minutes.
You need to assign fitness to VSPs.
I have added a fitness model as
sim.InfoExec('fitness = (50 - ind.age)/50', exposeInd='ind'),
which basically means fitness ~ 1 for ind.age=2
and ~0.6
for ind.age = 17
. You can define your own fitness model in a similar fashion.
That works perfectly! Thanks.
I've added my latest script (Bat_3agecat.py). I've added a third age category and added some recombination.
I was wondering if :
Thanks.