FitzPatrick_Vincent_FinalProject_EvolutionLifeHistories

No preview image

1 collaborator

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 231 times • Downloaded 22 times • Run 7 times
Download the 'FitzPatrick_Vincent_FinalProject_EvolutionLifeHistories' 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?

The Evolving Life Histories model that explores how traits related to the life-cycle of animals evolve under different conditions.

HOW IT WORKS

The evolving agents in this model are rats. Rats can eat, grow, mature, reproduce, and die by starvation or as hawk prey. Depending on the environmental conditions, rats will evolve to have different life history variables.

The evolving variables that belong to each rat are:

-AGE-OF-MATURITY: the age at which the juvenile (yellow) stage ends, growth stops, and reproduction begins. After AGE-OF-MATURITY, the rats are adults and turn white.

-FECUNDITY: the number of juvenile rats created each time an adult rat reproduces.

-ENERGY-T0-REPRODUCE: the minimum ammount of energy needed to reproduce.

-TIME-TO-REPRODUCE: the time that must elapse before an adult rat can reproduce again. When it passes, a rat turns orange and looks for another adult rat nearby to mate with.

When a rat finds a mate, it produces juveniles with new variable values. These four variables are set by a normal distribution around the mean of the two parental values. This allows the variables to "mutate", which is necessary for evolutionary change.

Rats are also given a certain ammount of energy at birth, proportional to the mother's ENERGY-TO-REPRODUCE / FECUNDITY. They are also given a BODY-SIZE, proportional to the ammount of energy they have.

As a juveile rat grow, its BODY-SIZE increases by 0.42*BODY-SIZE^.75 each tick.

The ENERGY value of a rat is controlled by the available food and the metabolic rate. The amount of energy a rat can eat each tick scales to body-size at 10*BODY-SIZE^0.67. For adults, the metabolic rate scales to body-size at 6*BODY-SIZE^0.67. In juveniles, who have extra energy costs for growth, metabolic rate scales to 6*BODY-SIZE^0.72. A rat can only gain ENERGY if the patch they are standing on is green; if they eat the patch, the patch turns brown and will not turn green again until REGROWTH-TIME. The rats lose ENERGY every single tick.

At reproduction, a rat also loses ENERGY-TO-REPRODUCE. If ENERGY < 0, the rat dies.

Hawk populations never change unless changed by the user. Hawks will eat one rat if there is a rat below them.

HOW TO USE IT

You can adjust the initial number of rats and hawks on the left.

Adjust the initial values for evolving variables with the sliders on the left. If you want to make it so the rats all have the same value throughout the run, turn the coresponding PEG-? switch ON after you chose the initial value. This variable will not evolve.

If you want to make the hawks eat only adults or only juveniles, adjust the EAT-ONLY-ADUTLS? and EAT-ONLY-JUVENILES? switches on the left. If both are off, the hawks will eat all rats.

Adjust the REGROWTH-TIME of the patches with the slider on the left.

The graphs on the left show the moving averages (for the last 100 ticks) of the evolvable variables and body size.

THINGS TO NOTICE

If you introduce a sudden change in environmental variables (NUMBER-OF-HAWKS or REGROWTH-TIME), the population will often grow quickly, or drop rapidly followed by a rapid regrowth period. Watch the variables when this happens. How do they change?

THINGS TO TRY

Peg one of the variables at high or low values and let the others evolve. See how changing the pegged variable causes changes in the other variables. Which variables seem more important?

Increase the number of hawks slowly over time. Do you see any trends in the evolvable variables?

EXTENDING THE MODEL

Right now, all rats give birth and can mate with any other adult rat. Try adding males into the model. Add in sexual dimorphism. What changes about the model?

Rats move around the view randomly, and cannot seek out food if they are starving. What happens if you give them the ability to head towards green patches preferentially?

Natural populations often experience cyclical changes in climate and predation. Do these changes affect life history traits in any way?

Drift and population size can significantly effect how populations evolve. Try putting the evolvability of the variables (the size of the standard deviation) on a slider, or adjusting the number of patches to support larger populatoins. How does the evolution of these life history traits change?

CREDITS AND REFERENCES

Model created by Vince FitzPatrick for EECS 372: DESIGNING AND CONSTRUCTING MODELS WITH MULTI-AGENT LANGUAGES. Special thanks to Uri Wilensky, Forrest Stonedahl, Aleata Hubbard and Winston Chang.

Comments and Questions

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

Click to Run Model

breed [rats rat]
breed [hawks hawk]

rats-own [energy
  age-of-maturity
  age
  body-size
  fecundity            
  energy-to-reproduce
  time-to-reproduce
  number-of-litters
  energy-loss-per-tick
  energy-gain-from-food
  time-since-last-birth
  max-energy
  offspring-age-of-maturity
  offspring-time-to-reproduce
  offspring-fecundity
  offspring-energy-to-reproduce]


patches-own [pcounter
  grass]

globals [  
  mean-bodysize-list
  mean-fecundity-list
  mean-ageofmaturity-list
  mean-energytoreproduce-list
  mean-timetoreproduce-list]

to setup
  clear-all
  set-default-shape rats "mouse side"
  set-default-shape hawks "hawk"
  create-rats number-of-rats [
    set color yellow
    setxy random-xcor random-ycor
    set-values-initial
   ]
  
  create-hawks number-of-hawks [
    set color red
    setxy random-xcor random-ycor
    set size 2 ]

   ask patches [set pcolor green
     set pcounter random regrowth-time]       
  


  set mean-bodysize-list []
  set mean-fecundity-list []
  set mean-ageofmaturity-list [] 
  set mean-energytoreproduce-list []
  set mean-timetoreproduce-list []
end 

to set-values-initial
  set age-of-maturity initial-age-of-maturity
  set fecundity  initial-fecundity 
  set time-to-reproduce initial-time-to-reproduce
  set energy-to-reproduce initial-energy-to-reproduce
    
  set age random age-of-maturity
  set body-size 1
  set size  (body-size ^ .334)    ;;body-size is representative of weight, while "size" is closer to length. They scale with a .334 power
  set number-of-litters 0 
  set energy 10.35 * body-size ^ 0.92 ;;integral of energy-gain - energy-loss from 0 to body-size
end 

;--------------------

to go
  mature                               ;grow
  ask rats [
    eat                                ;then eat (gain E)
    move-rats                          ;then move (lose E)
    set age age + 1]
  reproduce                            ;then reproduce (maybe)
  check-hawks
  ask hawks [
    move-hawks
    eat-rats]
  ask patches [

  set pcounter pcounter + 1]
  ask patches with [ (pcolor = brown) and ( pcounter > regrowth-time)] [
    set pcolor green]
  if not any? rats [stop]
  ask links [die]
  tick


  update-means
  update-plots
end 


;----------------------
; rat procedures

to eat
  set energy-gain-from-food (10 * ((body-size)) ^ .67)
  if [pcolor] of patch-here = green [
    set energy energy + energy-gain-from-food
    ask patch-here [set pcolor brown
      set pcounter 0]]
end 

to move-rats
  ask rats with [color = yellow] [set energy-loss-per-tick (6 * ((body-size)) ^ .72)]
  rt random 45
  lt random 45
  fd body-size ^ .24           ;;after Calder 1983
  set energy energy - energy-loss-per-tick
  ask rats with [energy < 0] [die]                    ;;this is where, if energy < 0, rats die
end 

to mature
  ask rats with [color = yellow] [
    set body-size body-size + .42 * (body-size) ^ .75         ;;Hill and Haruto
    set size  (body-size ^ .334) 
    
  
    if age > age-of-maturity [
      set color white
      set energy-loss-per-tick (6 * ((body-size)) ^ .67)
      set time-since-last-birth time-to-reproduce
      set number-of-litters 0
      set max-energy 10.35 * body-size ^ 0.92]]  ;;integral of dE/dW from 0 to size of rat
end 

to reproduce
  ask rats with [color = white ] [set time-since-last-birth time-since-last-birth + 1]               
  ask rats with [ (color = white) and (time-since-last-birth > time-to-reproduce) ][
    set color 26]
  ask rats with [color = 26][
      if energy > max-energy [set energy max-energy]
      ifelse energy-to-reproduce > energy [ set energy 0
        set time-since-last-birth 0
        set color white]
      
      [if any? other rats with [color != yellow] in-radius size [
        create-link-to one-of other rats with [color != yellow] in-radius size
        
        set offspring-age-of-maturity ([age-of-maturity] of self + first [age-of-maturity] of out-link-neighbors) / 2
        set offspring-time-to-reproduce ([time-to-reproduce] of self + first [time-to-reproduce] of out-link-neighbors) / 2
        set offspring-fecundity ([fecundity] of self + first [fecundity] of out-link-neighbors) / 2
        set offspring-energy-to-reproduce ([energy-to-reproduce] of self + first [energy-to-reproduce] of out-link-neighbors) / 2
      
        set time-since-last-birth 0
        set number-of-litters number-of-litters + 1
      hatch fecundity [
        set color yellow
        set-values-offspring
        set heading random 360
        fd 1
        ]
       set color white
      set energy energy - energy-to-reproduce
      ]]]
end 

to set-values-offspring
  set age 0

                                                                               
  set energy (energy-to-reproduce / (fecundity) )     ;;parental investment, where we estimate that Emet covers the Emet of offspring too
  
  set body-size 0.08 * energy ^ 1.09
  

  set age-of-maturity random-normal offspring-age-of-maturity 2
  set energy-to-reproduce random-normal offspring-energy-to-reproduce 2
  set time-to-reproduce random-normal offspring-time-to-reproduce 2
  set fecundity random-normal offspring-fecundity 1
  
  if peg-aom? [set age-of-maturity initial-age-of-maturity]
  if peg-fec? [set fecundity initial-fecundity]
  if peg-ttr? [set time-to-reproduce initial-time-to-reproduce]
  if peg-etr? [set energy-to-reproduce initial-energy-to-reproduce]
  
  set size (body-size ^ .334)
end 






;--------------------------
; hawk procedures

to move-hawks
  rt random 45
  lt random 45
  fd 1
end 

to eat-rats
  
  ifelse eat-only-adults? [
    set eat-only-kids? false
    if any? rats-here with [color != yellow] [
      ask one-of rats-here with [color != yellow] [die]]]
  [
  ifelse eat-only-kids? [
    if any? rats-here with [color = yellow] [
      ask one-of rats-here with [color = yellow] [die]]]
  [if any? rats-here [
    ask one-of rats-here [die]]
  ]]
end 

to check-hawks                               ;;adjusts hawk number mid-run
  if count hawks != number-of-hawks [
    ifelse count hawks > number-of-hawks [
      ask n-of (count hawks - number-of-hawks) hawks [die]]
    [create-hawks (number-of-hawks - count hawks) [
            set color red
            setxy random-xcor random-ycor
            set size 2]]]
end  




;---------------------------------
;grass procedures

to regrow
  set pcounter pcounter + 1
  ask patches with [ pcounter > regrowth-time] [
    set pcolor green]
end 

;-----------------------------
;other procedures

to update-plots
  if any? rats with [color != yellow] [

  set-current-plot "body-size"
    plot mean mean-bodysize-list
    
  set-current-plot "energy-to-reproduce"
    plot mean mean-energytoreproduce-list
    
  set-current-plot "fecundity"
    plot mean mean-fecundity-list
  
  set-current-plot "age-of-maturity"
    plot mean mean-ageofmaturity-list
  
  set-current-plot "time-to-reproduce"
    plot mean mean-timetoreproduce-list
    
    ]
  
  
  set-current-plot "population"
  set-current-plot-pen "total"
  plot count rats
  set-current-plot-pen "adult"
  plot count rats with [color != yellow]
  set-current-plot-pen "juvenile"
  plot count rats with [color = yellow]
end 

to update-means
  if any? rats with [color != yellow ] [
    
    set mean-bodysize-list lput (mean [body-size] of rats with [color != yellow]) mean-bodysize-list
    if (length mean-bodysize-list > 100) [set mean-bodysize-list but-first mean-bodysize-list]
    
    set mean-fecundity-list lput (mean [fecundity] of rats with [color != yellow]) mean-fecundity-list
    if (length mean-fecundity-list > 100) [set mean-fecundity-list but-first mean-fecundity-list]
    
    set mean-ageofmaturity-list lput (mean [age-of-maturity] of rats with [color != yellow]) mean-ageofmaturity-list
    if (length mean-ageofmaturity-list > 100) [set mean-ageofmaturity-list but-first mean-ageofmaturity-list]
    
    set mean-energytoreproduce-list lput (mean [energy-to-reproduce] of rats with [color != yellow]) mean-energytoreproduce-list
    if (length mean-energytoreproduce-list > 100) [set mean-energytoreproduce-list but-first mean-energytoreproduce-list]
    
    set mean-timetoreproduce-list lput (mean [time-to-reproduce] of rats with [color != yellow]) mean-timetoreproduce-list
    if (length mean-timetoreproduce-list > 100) [set mean-timetoreproduce-list but-first mean-timetoreproduce-list]
  ]
end 

There are 6 versions of this model.

Uploaded by When Description Download
Vince FitzPatrick almost 13 years ago No description provided Download this version
Vince FitzPatrick almost 13 years ago No description provided Download this version
Vince FitzPatrick almost 13 years ago No description provided Download this version
Vince FitzPatrick almost 13 years ago No description provided Download this version
Vince FitzPatrick almost 13 years ago Version1 Download this version
Vince FitzPatrick almost 13 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.