Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started