The Task

Use Netlogo to produce a rabbit simulator.

In this assignment we will expand the rabbit simulation from class. Begin with the rabbits and grass simulator from class. Most of what follows is already implemented. Here is what your finished product must look like:

  • There must be a breed called rabbits.
  • The interface must have a slider for the number of initial rabbits with range from 1 to 1000.
  • The interface must have a slider for the initial percentage of grass when the program starts.
  • The interface must have sliders for wiggle angle (range 0 to 360) and wiggle step (0.1 to 2.0).
  • The interface must have a slider for percentage grass which is the percentage of patches that turn green in the grow procedure described below.
  • The interface must have a slider for initial energy of each of the rabbits (range 0 to 10).
  • The interface must have a slider for wiggle energy is the energy cost for each wiggle operation (range 0 to 1 step of 0.1).
  • The interface must have a slider for grass energy is the energy a rabbit gets by eating a patch of grass (range 0 to 2 step of 0.1).
  • The interface must have a slider for birth threshold is the minimum amount of energy you have to have to give birth. Above this energy and you hatch (range 0 to 10).
  • The interface must have a slider for birth cost is how much energy it costs to give birth (range 0 to 10)
  • The interface must have a slider for max age is the maximum age of a rabbit (range 0 to 100)
  • Of course, Setup, Step, and Go buttons.
  • Rabbits are created at a random location and given reasonable initial values from sliders.
  • The rabbits are white.
  • The rabbits are rabbit shaped see the "Turtle Shapes Editor" and import the shape. Be sure it is rotatable and points "up".
  • Patches are either color number 33 (dark brown) or green and created using the appropriate slider number.
  • Plot the number of rabbits and the number of patches of grass.
  • The go routine should stop if there are no more rabbits.
  • In the go routine rabbits will wiggle, eat, birth, death, and age by 1 every time the go routine is run. Patches will grow.
  • Wiggle is standard wiggle idiom and has an energy cost.
  • Eat converts grass the rabbit is on from green to color 33 (dark brown) and adds the energy from the grass to the rabbit.
  • Birth happens if there is enough energy and costs the birth cost in energy. The remaining energy is divided between rabbit and kit (baby rabbit). The baby rabbit is given a random heading and a starting age.
  • Death happens if the rabbit runs out of energy or the rabbit is too old. If the max age is set to 0, however, the old age check is not done.
  • Grass is grown as suggested in class. If a patch is green is will set a random neighbor patch to green with percent-grow probability.
Here is a picture of what your program might look like and some output for the settings given:

Submission

Save your results as a .nlogo file and submit the file to the the BBLearn assignment. See BBLearn.