Hockenberry_Adam_evolvability

No preview image

1 collaborator

Default-person Adam Hockenberry (Author)

Tags

(This model has yet to be categorized with any tags)
Model group EECS 372-Spring 2011 | Visible to everyone | Changeable by the author
Model was written in NetLogo 4.1.2 • Viewed 214 times • Downloaded 38 times • Run 4 times
Download the 'Hockenberry_Adam_evolvability' modelDownload this modelEmbed this model

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


WHAT IS IT?

This model represents a 'petri-dish' type of experiment to investigate bacterial evolution and the generation of variation within a population.

HOW IT WORKS

Each bacterial organism eats, moves, reproduces and dies. Bacteria eat an amount from the environment that is determined by the degree of match between their 'genome' and the 'genome' of the environment. Upon reaching a certain level of energy, bacteria reproduce and give their offspring their traits with a certain error level that is specific to each bacteria and is also passed on with error. At each time step they also lose energy and if their rate of energy intake from the environment isnot sufficient such that an organisms energy drops to zero, they will die.

The environment regrows nutrients according to parameters and has a ceiling on how many nutrients that it can hold. According to a switch, the genome of the environment can change randomly and the frequency and magnitude of these changes are controllable by a slider. In addition, the fitness landscape can be made rugged by toggling the sliders representing the breadth and depth of fitness valleys which randomly set values for each gene that decrease nutrient uptake from the environment.

HOW TO USE IT

Initialize the environment with a defined maximum food and nutrient regrowth rate. The combination of these two will influence the carrying capacity of the environment. Initialize with a defined error-rate, valley depth, and valley breadth. If environmental change is True, initialize the frequency and magnitude of environmental changes as these will drastically effect population dynamics.

THINGS TO NOTICE

With environmental change present in the system, how do the population dynamics change compared to when there is no environmental change? What about the match of individuals to the environment and the average error-rate? What happens when the maximum match drops below 40%? Why is this?

THINGS TO TRY

Investigate different frequencies and magnitudes of environmental change, is there an optimum combination that produces high error-rates? Are there environmental changes that are too difficult for the population handle? Why might this be the case?

What if you introduce environmental changes mid-way through the model running, what happens to the population?

EXTENDING THE MODEL

The current map between genome to environment is unrealistic since we know that genes are transcribed and translated into functional protein products which do the bulk of intracellular work. Inserting a parameter that does this with an error-rate endogenous to each bacteria could produce different results that may be more realistic.

CREDITS AND REFERENCES

This project was created and implemented by Adam Hockenberry for use in EECS 372/472, Spring 2011, at Northwestern University.

Last modified: 06/04/2011

Comments and Questions

Please start the discussion about this model! (You'll first need to log in.)

Click to Run Model

turtles-own [ genomeT energy error-rate generation match ]
patches-own [ genomeP food ]
globals [ temp fitness-valley ]

to setup ;;set up according to user defined variables in the interface
    ca
    create-turtles starting-population 
    ask turtles [
      set shape "line"
      set size 1.5
      set generation 1
      set energy 20 
      set error-rate original-error-rate
      setxy random-xcor random-ycor
      set genomeT (list (random-float 1) (random-float 1) (random-float 1) (random-float 1) (random-float 1)) ;;sets each turtle genome to be a list of 5, random, floating point numbers
    ]
    
    set temp (list (random 2) (random 2) (random 2) (random 2) (random 2))  ;;makes it so each patch will have the same genome
    
    ask patches [ 
      set food max-food
      set pcolor scale-color brown food 15 0 ;; color of patches indicates nutrients available
      set genomeP temp  ;;tell each patch to set genome 
    ]
    
    set fitness-valley (list (random-float 1) (random-float 1) (random-float 1) (random-float 1) (random-float 1)) ;;sets what genome values will punish turtles
end 

to go
  if not any? turtles [ stop ] 
  update-plots
  ask turtles [
    move
    eat
    reproduce?
    die?
  ]
  ask patches [
    grow
  ]
  environment-change
  tick 
end 

to die?
  if energy <= 0 [ ;; turtles die if they have 0 energy
    die ]
end 

to eat
  set match 0
  (foreach genomeT genomeP [ set match ( match + abs(?1 - ?2))]) ;;each turtle compares its genome to the enivronment and calculates the difference
  set match ( 5 - match ) ;;the highest possible match would be 0, this simply inverts that number to calculate how much the turtle will eat
  (foreach genomeT fitness-valley [ ;;having calculated a match, turtles are then punished if their value of any gene is in a fitness valley
      if ?1 > (?2 - valley-breadth) [
        if ?1 < (?2 + valley-breadth) [
          set match ( match - abs(valley-depth - abs(?1 - ?2)))]]]) ;;subtract these punishing scores from the turtles match
  if match < 0 [ set match 0 ]      ;;no turtle can have match values greater than 5 or less than 0
  ifelse food >= (match) ;;turtles eat an amount of food directly related to their match, patches lose this amount
    [ set energy (energy + match) 
      set food (food - match)]
    [ set energy (energy + food) ;; if a patch does not contain enough energy, turtles will take as much as possible
      set food 0 ]
end 

to environment-change
    if environmental-change? [ if random 1000 < frequency-of-changes [ ;;according to user parameters, the environmental genome will change stochastically
      ask patch 1 1 [ 
        repeat magnitude-of-changes [set temp (replace-item (random 5) genomeP (random 2))]]
      ask patches [
        set genomeP temp]]]
end 

to grow
  ifelse food <= max-food - nutrient-regrowth ;;patches regrow food up to a defined maximum and recolor themselves accordingly
    [set food (food + nutrient-regrowth) ]
    [set food max-food]
  set pcolor scale-color brown food 15 0
end 

to move
  lt random 45 ;; turtles move pseudo randomly with a bias in their current direction
  rt random 45
  fd 1
  set energy (energy - 2) ;; turtles lose energy at each time step 
end 

to reproduce?
  if energy >= 100 [ 
    set energy 20 ;;reproduction costs a turtle 80 energy points
    hatch 1 ;;only one offspring at a time
    set generation (generation + 1) ;;offspring inherit parents generation plus 1
    set heading random 360 ;; offspring leave their parents 
    set error-rate (error-rate * (random-normal 1 error-rate)) ;; error rate is passed according to a random-normal distribution
    if error-rate >= 1 [set error-rate 1] ;;error rates have a maximum of 1 and a minimum of 0.1
    if error-rate <= 0.1 [ set error-rate 0.1]
    set genomeT (map [? * random-normal 1 error-rate] genomeT) ;; genome is passed according to a random-normal distribution
    set genomeT (map [min (list 1 ? )] genomeT) ;; genes have a max value of 1 and a minimum value of 0
    set genomeT (map [max (list 0 ? )] genomeT)    
    fd 1 ] 
end 

to update-plots
  set-current-plot "Population"
  plot count turtles 
  
  set-current-plot "Generation"
  set-current-plot-pen "Max"
  plot max [Generation] of turtles
  set-current-plot-pen "Min"
  plot min [Generation] of turtles
  set-current-plot-pen "Average"
  plot mean [Generation] of turtles
  
  set-current-plot "Error-Rate"
  set-current-plot-pen "Max"
  plot max [error-rate] of turtles
  set-current-plot-pen "Min"
  plot min [error-rate] of turtles
  set-current-plot-pen "Average"
  plot mean [error-rate] of turtles
  
  set-current-plot "Match"
  set-current-plot-pen "Max"
  plot max [ match / 5 * 100 ] of turtles
  set-current-plot-pen "Min"
  plot min [ match / 5 * 100] of turtles
  set-current-plot-pen "Average"
  plot mean [ match / 5 * 100 ] of turtles
end 


There are 5 versions of this model.

Uploaded by When Description Download
Adam Hockenberry about 14 years ago comment, final polishing Download this version
Adam Hockenberry about 14 years ago environmental change Download this version
Adam Hockenberry about 14 years ago error rates added Download this version
Adam Hockenberry about 14 years ago genomes integrated Download this version
Adam Hockenberry about 14 years ago Initial upload Download this version

Attached files

No files

This model does not have any ancestors.

This model does not have any descendants.