CSC107 - Lab 8
Population
Assigned March 26th
Due March 29th 5 pm
Show your work on all questions for full credit.
References
Rabbits and Carrots
Question 1
There are many parameters for the population model that can have an effect on our resulting
dynamics. These are
- Initial Population of Rabbits
- Initial Population of Carrots
- Energy from eating carrot
- Energy needed to hatch new Rabbit
- Degree of wiggling
- Percent of carrots that hatch each time
By creating sliders for all of these parameters, we can more directly change these values without
having to go back to the blocks code, and can actually change them while the model is running.
Make the above parameters into sliders having reasonable minimum and maximum values, and find a
set of parameters that keeps the rabbits alive as long as possible.
Question 2
The carrot reproduction is a little unrealistic. Alter this as follows
- In setup, carrots are randomly assigned a germination time between 4 and 20.
- Carrots are also assigned a lifetime, which is initially equal to 0
- Each time through the forever loop, a carrot adds 1 to its lifetime
- When a carrot's lifetime equals its germination, it hatches, and resets its own lifetime and that of it's child back to 0.
What effect does this have on the overall selection of parameters you used in Question 1?
Question 3
Use the algorithm from the Bears and Flowers model to have the
rabbits actively smell carrots instead of always wiggling. That is
- Turn 45 degrees to the left
- Go forward 5 spaces
- Sniff for carrots and remember
- Go back 5 spaces
- Turn 90 degrees right
- Go forward 5 spaces
- Sniff for carrots and remember
- Go back 5 spaces
- Turn 45 degrees left
- Change direction toward whichever direction had more flowers
What effect does this have on the
overall selection of parameters you used in Question 1?
© Mark Goadrich 2012, Centenary College of Louisiana