# Red Queen

Do you have questions or comments about this model? Ask them here! (You'll first need to log in.)

## WHAT IS IT?

This model demonstrates the ideas of competitive co-evolution. In the model there are two species: frogs and snakes. The snakes are the only predators of the frogs, but the frogs produce a fast acting poison that kills the snakes before they can be eaten. However, the snakes have developed an anti-venom to counter the frog's poison. In this model, we assume that there are no other predators of the frogs, or prey that are consumed by the snakes. As such the two species enter a biological arms race in order to keep up with each other.

The name Red Queen comes from Lewis Carroll's "Through the Looking Glass", where the Red Queen says, "...it takes all the running you can do, to keep in the same place." In this model under the right conditions, the two species evolve as fast as they can, but neither is able to gain an advantage over the other.

## HOW IT WORKS

When SETUP is pressed, INITIAL-NUMBER-SNAKES and INITIAL-NUMBER-FROGS are created. Each of these have a poison or resistance drawn from a normal distribution with means of INITIAL-RESISTANCE-MEAN and INITIAL-POISON-MEAN with a standard deviation of 1.

Once GO is pressed, all organisms move with a random walk. When a snake encounters a frog, the snake will try to eat the frog. If the frog's poison is stronger than snake's resistance the snake will die. If the snake's resistance is higher than the frog's poison the frog will die. If the poison and resistance are equal then both individuals survive.

At the end of every tick, each animal get a chance to reproduce. In order to reproduce the count of its species must be below half of MAX-INDIVIDUALS. The chance of reproduction is still 5 in 100. If the animal does reproduce, a new individual is created which has a resistance or poison drawn from a normal distribution with mean equal to the parent's value, and standard deviation of 1.

## HOW TO USE IT

First set the parameters of the model. INITIAL-NUMBER-SNAKES and INITIAL-NUMBER-FROGS controls the initial number of each species. INITIAL-RESISTANCE-MEAN and INITIAL-POISON-MEAN control the distributions from which the initial values for the snakes and frogs, respectively. MAX-INDIVIDUALS controls the total carrying capacity of the environment. Once these values are set, press SETUP and GO to watch the model run.

## THINGS TO NOTICE

With the initial settings of the model, both of the species will usually persist for a long period of time. Both of the species persist, but their population levels change over time, what is the relationship between the populations of the frogs and snakes? What happens to the levels of the poison and resistance during this time?

## THINGS TO TRY

Modify the INITIAL-RESISTANCE-MEAN and INITIAL-POISON-MEAN, do both species continue to persist? What happens to the resistance and poison values?

Set the INITIAL-RESISTANCE-MEAN and INITIAL-POISON-MEAN to the same value, but change the INITIAL-NUMBER-FROGS and INITIAL-NUMBER-SNAKES, what happens to the population levels over time? What happens to the poison and resistance values?

## EXTENDING THE MODEL

The frogs have their own shape, "frog top" but the snakes use the default turtle shape. Create a snake shape for the snakes.

Originally, the reproduction of the individuals in this model is a global mechanism in that random individuals all over the environment are selected to reproduce, and snakes and frogs are selected equally likely. We have changed this mechanism so that each agent gets a chance to reproduce each turn, making the reproduction rate population dependent, but there are many ways to make this change. Implement another individual-based mechanism. After this, change the model so that individuals that succeed in fights reproduce preferentially.

Currently the species in this model reproduce asexually. Change the model so that it uses sexual reproduction.

## NETLOGO FEATURES

This model uses the "frog top" shape that was imported from the Shapes Library.

## RELATED MODELS

This model is related to the other BEAGLE models since they all examine evolution.

## CREDITS AND REFERENCES

This model is a part of the BEAGLE curriculum (http://ccl.northwestern.edu/simevolution/beagle.shtml)

This model is related to a model that was used as the basis for a poster published at the Genetic and Evolutionary Computation Conference. This model uses a more individual-based reproductive mechanism, whereas the model in the paper used a global one:

"Coevolution of Predators and Prey in a Spatial Model: An Exploration of the Red Queen Effect" Jules Ottino-Loffler, William Rand, and Uri Wilensky (2007) GECCO 2007, London, UK

## HOW TO CITE

If you mention this model in a publication, we ask that you include these citations for the model itself and for the NetLogo software:

- Ottino-Loffler, J., Rand, W. and Wilensky, U. (2007). NetLogo Red Queen model. http://ccl.northwestern.edu/netlogo/models/RedQueen. Center for Connected Learning and Computer-Based Modeling, Northwestern Institute on Complex Systems, Northwestern University, Evanston, IL.
- Wilensky, U. (1999). NetLogo. http://ccl.northwestern.edu/netlogo/. Center for Connected Learning and Computer-Based Modeling, Northwestern Institute on Complex Systems, Northwestern University, Evanston, IL.

## COPYRIGHT AND LICENSE

Copyright 2007 Uri Wilensky.

This work is licensed under the Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License. To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-sa/3.0/ or send a letter to Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA.

Commercial licenses are also available. To inquire about commercial licenses, please contact Uri Wilensky at uri@northwestern.edu.

## Comments and Questions

breed [frogs frog] breed [snakes snake] frogs-own [struggle? poison] snakes-own [resistance] to setup ca ask patches [ set pcolor white ] set-default-shape frogs "frog top" setup-individuals growth-plot trait-plot reset-ticks end to setup-individuals create-frogs initial-number-frogs [ set size 1 set poison random-normal initial-poison-mean 1 setxy random-xcor random-ycor set struggle? false set color red ] create-snakes initial-number-snakes [ set size 1 set resistance random-normal initial-resistance-mean 1 setxy random-xcor random-ycor set color blue ] end to go ask snakes [ if resistance < 0 [die] rt random-float 50 - random-float 50 fd 1 if any? frogs-here [ hunt-frogs ] ] ask frogs [ if poison < 0 [die] rt random-float 50 - random-float 50 fd 1 set struggle? false ] ;; original global reproduction mechanism ;; while [count turtles < max-population] [ ;; ifelse random 2 = 0 [ ;; ask one-of snakes [ reproduce ] ;; ] ;; [ ;; ask one-of frogs [ reproduce ] ;; ] ;; ] ;; new individual-based reproduction mechanism ask turtles [ if breed = frogs and count frogs < max-population / 2 and random 100 < 5 [ reproduce ] if breed = snakes and count snakes < max-population / 2 and random 100 < 5 [ reproduce ] ] tick growth-plot trait-plot end to hunt-frogs let hunted one-of (frogs-here with [not struggle?]) if hunted != nobody [ ask hunted [ set struggle? true ] ifelse resistance > [ poison ] of hunted [ ask hunted [ die ] ] [ if resistance != [ poison ] of hunted [ die ] ] ] end to reproduce if breed = frogs [ hatch 1 [ set poison random-normal [ poison ] of myself 1 ] ] if breed = snakes [ hatch 1 [ set resistance random-normal [resistance] of myself 1 ] ] end to growth-plot set-current-plot "populations" set-current-plot-pen "frogs" plot count frogs set-current-plot-pen "snakes" plot count snakes end to trait-plot set-current-plot "traits" set-current-plot-pen "poison" plot average-poison set-current-plot-pen "resistance" plot average-resistance end to-report average-poison ifelse count frogs > 0 [ report mean [ poison ] of frogs ] [ report 0 ] end to-report average-resistance ifelse count snakes > 0 [ report mean [ resistance ] of snakes ] [ report 0 ] end ; Copyright 2007 Uri Wilensky. ; See Info tab for full copyright and license.

There are 11 versions of this model.

## Attached files

File | Type | Description | Last updated | |
---|---|---|---|---|

Red Queen.png | preview | Preview for 'Red Queen' | over 11 years ago, by Uri Wilensky | Download |

This model does not have any ancestors.

This model does not have any descendants.