Lesson 3 Activity 1 - Add a Predator

Now that we have created a simple ecosystem with two trophic levels, we might want to ask some questions about more complicated ecosystems with more trophic levels. In this lesson students will modify the Rabbits and Grass model by adding a predator, a Mountain Lion, to answer a new question. “Does adding top predator increase or decrease the stability of an ecosystem?”
  • Watch the video that describes the challenge, to add a predator
  • Learn New CS Concepts and Commands
    • how to add breeds
    • how to add user-defined agent variables
  • Add a predator
  • Test your model

Video introduction to the challenge: adding a predator

New CS concepts and commands:


Use the Edit Breeds button in the Spaceland area to create a new breed.

Click on “Add Breed” to add a new breed.

In the “New Breed” dialog box, give the breed a name and press OK.

You will see the Breed on the next panel.  (We added the breed called “Mountain Lion.”)


Next, click Edit Traits next to the new breed label for “Mountain Lion.”

Create a new trait (or variable) for the Mountain Lion breed called “Pred-energy.”

The set my (trait) to (value) block is used to set an agent’s trait to some value.  In this case, the Mountain Lion’s Pred-energy is a being initialized.

Add a predator:
Add a new breed for a predator called Mountain Lion then add a user defined variable or trait called "Pred-energy". Remember to create the Mountain Lion in the setup and set its traits there.  Then add some predator behaviors. Hint: Look at the Rabbit breed’s procedures for Hop, Reproduce, and Die. If you want similar behaviors for the Mountain Lion, simply copy and paste those procedures from the Rabbit page into the Mountain Lion page and customize them for the Mountain Lion's behavior.

Test and Debug:
  • After adding your breed and creating it, test your setup. Did your Mountain Lion appear? Is it the color, shape and size you wanted it to be?
  • Test your predator's behaviors.
  • Test your model. Check to see if your agents react to collisions and if your agents move, reproduce and die as expected.


Upload a link to your model and a reflection on adding a new breed to your portfolio in the section "SL Nova Projects- Life" under the heading "Adding a Predator".