Question: procreate(orgl,popSize,mutProb) You will now write a function called procreate that takes a list of organisms orgL as input. It causes these to reproduce a population

procreate(orgl,popSize,mutProb) You will now write a function called procreate that takes a list of organisms orgL as input. It causes these to reproduce a population of popSize progeny organisms which it returns as a list. Replication is done with a probability of mutation mutProb. The simulator functions which you write below will call procreate in order to produce the next generation of organisms. procreate should operate by sampling (with replacement) an organism, calling that organisms's.replicate method to reproduce, and storing the resulting progeny organism in a list. It should repeat this process until it has produced a new list of organisms popSize large. Sampling with replacement can be accomplished using random.choice(L), where L is a list. For example: >>> import random >>> exampleL=['h','i','v'] >>> random.choice (exampleL) # because this uses randomness, you'll get different results each time you call it Ti' >>> random.choice (exampleL) 'v' procreate(orgl,popSize,mutProb) You will now write a function called procreate that takes a list of organisms orgL as input. It causes these to reproduce a population of popSize progeny organisms which it returns as a list. Replication is done with a probability of mutation mutProb. The simulator functions which you write below will call procreate in order to produce the next generation of organisms. procreate should operate by sampling (with replacement) an organism, calling that organisms's.replicate method to reproduce, and storing the resulting progeny organism in a list. It should repeat this process until it has produced a new list of organisms popSize large. Sampling with replacement can be accomplished using random.choice(L), where L is a list. For example: >>> import random >>> exampleL=['h','i','v'] >>> random.choice (exampleL) # because this uses randomness, you'll get different results each time you call it Ti' >>> random.choice (exampleL) 'v
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
