Divergent Evolution

Divergent Evolution preview image

1 collaborator

Tags

(This model has yet to be categorized with any tags)
Visible to everyone | Changeable by the author
Model was written in NetLogo 5.0.4 • Viewed 342 times • Downloaded 29 times • Run 0 times
Download the 'Divergent Evolution' modelDownload this modelEmbed this model

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


Comments and Questions

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

Click to Run Model

;; Simulate divergent evolution in a population. Have 2 different regions of the world, 
;; representing 2 different food sources for the turtles. Turtles with bigger beaks are
;; more suited to eat one region, smaller are more suited to the other.
;; All turtles start out with a similar sized "beak."


turtles-own [ beak-size energy ]
patches-own [ countdown food-type ]

to setup
  ca
  ask patches 
  [ set countdown random food-regrowth-time
    ifelse random 100 < percent-green 
    [set pcolor 56] [set pcolor 46]
    ifelse pcolor = 46 
    [ set food-type 1 ]
    [ set food-type 2 ] ]
  crt initial-birds 
  [ setxy random-xcor random-ycor
    set shape "bird side"
    set size 2
    set beak-size (10 + random-float 1 - random-float 1)
    set color scale-color violet beak-size 0 20
    set energy initial-energy ]
  reset-ticks
end 

to go
  move
  eat-food
  reproduce
  death
  grow-food
  tick
end 

to move
  ask turtles 
  [ rt random 50
    lt random 50 
    let dist random-float 1
    fd dist
    set energy energy - dist ]
end 

to eat-food
  ask turtles
  [ if beak-size > 0 and beak-size < 20
    [ if pcolor = 46 
      [ if max-one-of turtles-here [beak-size] = self 
        [ set energy energy + energy-from-food
          set pcolor 36 ]]
      if pcolor = 56 
      [ if min-one-of turtles-here [beak-size] = self 
        [ set energy energy + energy-from-food
          set pcolor 36 ]]]]
end 

to reproduce
  ask turtles 
  [ if energy > reproduction-energy
    [ set energy energy - initial-energy
      hatch 1 
      [ set energy initial-energy
        set beak-size beak-size + random-float 0.5 - random-float 0.5 
        set color scale-color violet beak-size 0 20 ]]]
end 

to death
  ask turtles 
  [ if energy <= 0 [ die ]]
end 

to grow-food
  ask patches 
  [ if pcolor = 36 
    [ ifelse countdown <= 0
      [ ifelse food-type = 1 
        [ set pcolor 46 ]
        [ set pcolor 56 ]
        set countdown food-regrowth-time ]
      [ set countdown countdown - 1 ]]]
end 

There is only one version of this model, created over 11 years ago by Madison Fitzpatrick.

Attached files

File Type Description Last updated
Divergent Evolution.png preview Preview for 'Divergent Evolution' over 11 years ago, by Madison Fitzpatrick Download

This model does not have any ancestors.

This model does not have any descendants.