Introduction to Complex Systems

Prof. Dirk Brockmann, Winter Term 2021

Practical Problem 11: Evolutionary dynamics

In this problem we will design a models that capture the key elements of evolutionary processes

  1. replication
  2. variation (mutation)

The idea is to reimplement the explorables:

  1. “Maggots in the Wiggle Room”
  2. “A Patchwork Darwinge”

Simulation 1

This is a turtle based simulation.

  • Write a model in which turtles move around randomly like we did in many previous simulations.
  • Each turtle should have a turtle specific property called fitness which you can implement using the turtles-own command
  • The initial turtle community can have uniform fitness say \(1\)


  • All turtles should die at a constant rate
  • All turtles should reproduce at a rate proportional to a basic reproduction rate multiplied by the individual fitness, e.g. you could define a slider variable basic-reproduction and implement this

ask turtles [
    if random-float 1 < basic-reproduction * fitness [
        hatch 1

  • turtles should be able to mutate which means that if a turtle hatches a new baby like above with a tiny probability that baby should have a different fitness either slightly less of slightly larger than the parent
  • when a mutation occurs the baby should also have a different color, so individuals with different fitness should be distinguishable by color. You can pick an random color using set color one-of base-colors.

Simulation 2

This is a similar model based on patches.

  • Like above we assign a fitness value to a patch using the patches-own command and initialize the fitness value of each patch.
  • In this simulation patches can turn neighboring patches into their own type (color and fitness) with a probability function that looks like this

[ P = \frac{1}{1+\exp\left( - \sigma (f_1 - f_2) \right)} ]

  • where $f_1$ and $f_2$ are the fitness parameters of the competing patches and $\sigma$ is a steepness parameter (slider), you can start with a value of $1$.

  • Implement mutations just like in simulation 1.