Difference between revisions of "CS382:Predator-Prey"

From Earlham CS Department
Jump to navigation Jump to search
Line 146: Line 146:
** This can be run in a browser on Firefox.
** This can be run in a browser on Firefox.
* [http://ccl.northwestern.edu/netlogo/models/WolfSheepPredation(SystemDynamics) Wolf Sheep Systems Dynamics netlogo model]
* [http://ccl.northwestern.edu/netlogo/models/WolfSheepPredation(SystemDynamics) Wolf Sheep Systems Dynamics netlogo model]
** Same for this.
** Same for this. <font color="darkmagenta">Maybe I'm just terrible at using the browser interface, but the diagram window did not pop up for me in either Firefox or Safari. Using the Netlogo on my machine, though, I had both windows for the diagram and testing. If I'm doing something wrong, then it needs instructions; otherwise we might need to make them download it for reals (gasp)</font>
<font color=red>Make a new model with the correct vermin.</font> <font color="darkmagenta">Could we also just change the name of the unit?</font>
<font color=red>Make a new model with the correct vermin.</font> <font color="darkmagenta">Could we also just change the name of the unit?</font>

Revision as of 08:37, 30 March 2009

Predator Prey ( Lynx Hare )


The predator prey unit will last for a week and a half. (Or, 3 classes) The purpose of this unit is to teach the students of this class about using system dynamics, using predator-prey interaction as a vehicle to facilitate the student's understanding of how the systems dynamics approach to modeling functions. This unit will consist of a lab where students use a couple of different simulation models to explore the intricacies of how predator and prey interact, both agent-based and system dynamics based.

Background Reading for Teachers and TAs

Reading Assignments for Students

  • Given the reference materials present so far, it's possible that rather than having a link to online reading assignments, we may have to create paper handouts based on the materials that we have links to.
  • A handout created from parts of the US Dept. Of Energy's guide to System Dynamics seems like a very good place to start.

Reference Material

Lecture Notes

Outline of the lectures designed to fit into 2 1:20 slots per week. This unit lasts 1 1/2 weeks, so requires 3 lectures. I dig the detail of these lecture notes. Do more!

Lecture 1:

  • Intro & Concepts
    • What is system dynamics? for instance, answer these
    • What is it for?
    • What does it let you do?
      • Systems dynamics lets you sketch out the relationships between all the components of a dynamic system, and given those relationships, will allow you to predict how the system behaves over a period of time. Will it result in a fluctuating growth? Exponential growth? Perfect equilibrium? All of these questions should be answerable using this type of model.
    • Why use System Dynamics? When should you use it?
      • The answer to this question is essentially the same as why you should use any other model. It's oftentimes quicker, cheaper and safer to alter a model and run tests on that than to alter a real system and run tests on that. Additionally, a failure in a model will allow you to predict a failure in a real system.
      • Failure in a real system often has catastrophic consequences, such as the loss of lives. The failure of a model is often much less devastating, resulting in perhaps a "Darn. Well, back to the drawing board." instead of "My son/daughter was in that building!"
    • Strengths / Weaknesses and list some of these
  • Basic Terminology (Building Blocks)
    • Time Paths
      • A time path is how something changes over time (either the whole system or an aspect of the system).
    • Link
      • Feedback Loop
    • Stock
      • A stock is a quantity of objects that's variable in nature. Examples of this are the number of sheep in a pasture, the number of fish in a pond, the amount of oil left in the world, the number of tanks in the US military, etc.
    • Flow
      • This represents the flow of resources either into or out of a stock. For instance, drilling would represent a flow out of the stock of oil in Alaska, and into the stock of oil in the US Oil Reserve.
  • Causal Loop Diagram
    • Pictures used to convey understanding of interactions or influences within the structure. It's used specifically to show the influential interactions between two elements of a structure.
    • The main conventions that are used to display a loop are the "+", "-", "S" and "O"
    • That is to say, that if a arrow is shown from A to B with a + on it, it means that A adds to B. As A increases, it adds more and more to B, and as it decreases, it adds less and less, but still adds to B
    • With a - shown with the arrow, A subtracts from B. As A grows, it subtracts more and more from B. As A diminishes, it subtracts less and less from B (But still subtracts)
    • With a S shown with the arrow, A and B grow in the same direction. This means that as A increases, B increases, and vice versa.
    • A O indicates that A and B grow in opposite directions, I.E. as A shrinks B grows and vice versa.
    • With no label, it indicates that A is considered a constant.
    • The Causal loop diagram gives no indication as to the strength of the influence of the two elements, it just shows the nature of the influence.
    • There are, generally speaking, two types of Causal loops. A Reinforcing loop and a Balancing loop.
      • In a reinforcing loop, each action adds to the other. An action that produces a result that produces more of the same action is a reinforcing loop.
      • In a balancing loop, any action attempts to bring two things to agreement. A situation where one tries to solve a problem or achieve a goal is representative of a balancing loop.

Lecture 2:

  • More Terminology
    • System Dynamics is interested in the behavior of systems over a period of time. Time paths are critical to expressing this.
    • Types of Time Paths
      • Linear Family
        • Growth / Decline
          • The notion that most systems grow / decline under a linear curve is in fact incorrect. A linear growth or decline indicates a system which is devoid of feedback.
          • Feedback is a crucial part for the growth or decay of any system.
        • Equilibrium
          • The expression of a system under which there is no pressure for change, or a system in which all variables reach their desired state at the same point in time
          • Note that this is an extremely artificial scenario, most systems do NOT reach or maintain equilibrium.
      • Exponential Family
        • Paths showing exponential growth and exponential decay. Real systems tend to grow along exponential paths rather than linear paths.
      • Goal-Seeking Family
        • Displayed in most living, and some nonliving systems
      • Oscillation Family
        • Sustained
          • Characterized by a predictable periodicity.
          • Predator-Prey relations are often characterized by this, as while the individual oscillations may vary, they often follow a predictable oscillating pattern in that the rise of the prey population indicates the rise of the predator population, and the decline of a prey population causes the decline of a predator population.
        • Dampened
          • Displayed by systems that display dissipation or relaxation processes, such as friction or information smoothing.
        • Exploding
          • Starts of smoothly, but grow until either the system settles down or is torn apart.
          • This pattern occurs infrequently in real-world situations, and doesn't last long when it does.
        • Chaos
          • A unique type of oscillation, as it basically represents a random pattern generated by a system that is devoid of randomness
      • S-Shaped Family
        • This is extremely visible in the Wolf Sheep Agent based netlogo model when the grass is taken out of the equation. The sheep population goes too high, which in turn causes the wolf population to increase too much, which leads to an irrecoverable decline in the sheep population. (Extinction)
        • This is referred to as an "Overshoot and crash" system.
  • Review of the "Building Blocks" of a System Dynamics model

Lecture 3:

  • Review of Class 1 and 2.
    • Still working on material for this. Fair enough



  • Open up the Netlogo Lynx-Hare model showing both an agent based model and an empty system dynamics model. They're going to need to know how to get to that one.
  • Given the rules of the agent based simulation, identify parts of the system dynamics model. How should they determine these?
    • Determine the stocks in this model.
    • Determine the flows.
      • Determine what effects the sheep birth / death rate.
      • Determine what effects the wolf birth / death rate.
    • Figure out the variables then look at how you can tweak the simulation.
  • Draw a causal loop diagram using the above information.
  • Implement the System Dynamics Netlogo model using the causal loop diagram. ??? I have only a vague idea of what this means. I can see that there's an interface in Netlogo to edit the diagram, but what exactly do they need to do?
  • Experiment with different values for the two models.
    • Make notes of what you notice.
  • In Excel, collect data points from a run of the agent based model. Fit a curve to this data. Using the curve equations, configure the system dynamics model to produce a result similar to the one gleaned from the agent-based simulation.
    • We will be providing a set of values for the agent-based model. Do you have these?
    • We need to determine exactly how to do this in Excel.
  • Evaluation for correctness / completeness.
    • Evaluate the correctness of the system dynamics model. How? Be more specific, please. For the poor confused freshmen.
    • Evaluate how well the results of the system dynamics model meshed with the results generated by the agent-based model.

  • For most of these steps, there will need to be more specific information for those who are not familiar with the procedures involved. This will be provided by us. Yep. You're supposed to do it as part of the lab writeup for this week for people to be able to do your lab. :P


  • Required Elements:
    • Provide all the stuff we told them to to in the procedure.
      • What are the stocks?
      • What are the flows?
      • How can the simulation be tweaked?
      • A causal loop diagram.
      • Netlogo implementation of the system dynamics model.
      • Excel file with the fit curve.
      • An explanation of how they came up with the values for the system dynamics model based on the fitted curve.
  • Visualization opportunities:
    • Placeholder.
  • Optional elements:
    • Placeholder.
  • Provide a template for the first couple of labs ala CS128?
    • Placeholder.


  • Wolf Sheep Agent based netlogo model
    • This can be run in a browser on Firefox.
  • Wolf Sheep Systems Dynamics netlogo model
    • Same for this. Maybe I'm just terrible at using the browser interface, but the diagram window did not pop up for me in either Firefox or Safari. Using the Netlogo on my machine, though, I had both windows for the diagram and testing. If I'm doing something wrong, then it needs instructions; otherwise we might need to make them download it for reals (gasp)

Make a new model with the correct vermin. Could we also just change the name of the unit?

Bill of Materials

  • I don't think it will be practical to try and conduct a lab for this unit with anything but software.
  • So far all the software that we've found is open-source and free.


CRS Questions

  • Look at the graph on Lynx - Hare as a Pred/Prey model. What type of oscillation does it show?
    • A. Chaos
    • B. Explosive
    • C. Dampening
    • D. Sustained
  • What is a good example of a reinforcing loop?
    • A. Uncontrolled fishing in a lake
    • B. Spilling wine on a carpet
    • C. A Stock Market crash
    • D. Parents buying a child toys

Quiz Questions

  • Look at the graph on Lynx - Hare as a Pred/Prey model. What is the average periodicity of the oscillation?
  • Give an example of a system with a explosive type of oscillating time path.
  • Pick a system from the following list, and draw a model of it.
    • System A
    • System B
    • Etc.

Predator Prey Metadata

This section contains information about the goals of the unit and the approaches taken to meet them.


  • Given that this unit employs agent-based modeling as a introductory element in order to make the switch to system dynamics, it would be best if this unit came after a unit on agent-based modeling, or at least a unit in which students were introduced to agent-based modeling.

Concepts and Techniques

This is a placeholder for a list of items from the context page.

General Education Alignment

  • Analytical Reasoning Requirement
    • Abstract Reasoning - From the [Catalog Description] Courses qualifying for credit in Abstract Reasoning typically share these characteristics:
      • They focus substantially on properties of classes of abstract models and operations that apply to them.
        • Analysis of this unit's support or not for this item.
      • They provide experience in generalizing from specific instances to appropriate classes of abstract models.
        • Analysis of this unit's support or not for this item.
      • They provide experience in solving concrete problems by a process of abstraction and manipulation at the abstract level. Typically this experience is provided by word problems which require students to formalize real-world problems in abstract terms, to solve them with techniques that apply at that abstract level, and to convert the solutions back into concrete results.
        • Analysis of this unit's support or not for this item.
    • Quantitative Reasoning - From the [Catalog Description] General Education courses in Quantitative Reasoning foster students' abilities to generate, interpret and evaluate quantitative information. In particular, Quantitative Reasoning courses help students develop abilities in such areas as:
      • Using and interpreting formulas, graphs and tables.
        • In this unit we have students create and examine formulas for modeling the relationships between the different parts of the systems. We also have them draw diagrams for representing their model and then use graphs and tables to analyze their results.
      • Representing mathematical ideas symbolically, graphically, numerically and verbally.
        • Systems dynamics is at it's core representing systems symbolically and mathematically.
      • Using mathematical and statistical ideas to solve problems in a variety of contexts.
        • We are using mathematics to solve problems.
      • Using simple models such as linear dependence, exponential growth or decay, or normal distribution.
        • In this unit we look at the concepts of linear and exponential growth and decay, among others.
      • Understanding basic statistical ideas such as averages, variability and probability.
        • Only so much as these ideas would be helpful in a particular model.
      • Making estimates and checking the reasonableness of answers.
        • Experimentation is used when developing models and there is an analysis part of our lab.
      • Recognizing the limitations of mathematical and statistical methods.
        • When comparing SD to Agent based we will go into the relative strengths and weaknesses of SD in general and as compared to Agent based modeling.
  • Scientific Inquiry Requirement - From the [Catalog Description] Scientific inquiry:
    • Develops students' understanding of the natural world.
      • They can model natural systems including our example, Predator-Prey models.
    • Strengthens students' knowledge of the scientific way of knowing — the use of systematic observation and experimentation to develop theories and test hypotheses.
      • Experimentation is used when developing models.
    • Emphasizes and provides first-hand experience with both theoretical analysis and the collection of empirical data.
      • We certainly provide some experience with theoretical analysis but not much empirical data will be collected.

Scaffolded Learning

  • The scaffold approach is more difficult to take with this unit than with some others, because rather than involving a grander and grander scope, it involves a transition from one type of modeling to another. The obvious answer here is to start out with a small system that we model, then move on to larger ones, but I'm not sure if I'm satisfied with that approach.

Inquiry Based Learning

Some prose.

Consider open-ended questions for the students to explore in the context of the lab. What happens when you change X? Why?

Predator Prey Mechanics

To Do

  • A list of items maintained by the authors, Charlie, and the Reviewers.


  • Put answers to CRS / quiz Qs in bold
    • Done.
  • Come up with something concrete, then go into detail on it (at least to the level of procedure). That'll make it easier to evaluate where to go with it in the greater scheme of things, and to offer suggestions for what might be most effective. Agreed.
    • Done.


Your names, URLs, etc.