GenEvo 3 Genetic Drift and Natural Selection

GenEvo 3 Genetic Drift and Natural Selection preview image

1 collaborator

My_photo_2 Sugat Dabholkar (Author)

Tags

(This model has yet to be categorized with any tags)
Part of project 'GenEvo Curriculum'
Visible to everyone | Changeable by everyone
Model was written in NetLogo 6.0-BETA1 • Viewed 418 times • Downloaded 30 times • Run 0 times
Download the 'GenEvo 3 Genetic Drift and Natural Selection' modelDownload this modelEmbed this model

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


Info tab cannot be displayed because of an encoding error

Comments and Questions

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

Click to Run Model

breed [ ecolis ecoli ]

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;; SETUP PROCEDURES ;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

to setup   ; Sets up the population of bacteria (E. coli) randomly across the world.
  clear-all
  let color-list [ gray red brown yellow green cyan violet magenta ]

  create-ecolis number-of-traits [
    set shape "ecoli"
    setxy random-xcor random-ycor
    set color first color-list
    set color-list but-first color-list ; each type has a unique color so we remove this color form our list
  ]

  reset-ticks
end 

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;; RUNTIME PROCEDURES ;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

to go
  ask ecolis [
    move
    reproduce
    check-if-dead
  ]
  tick
end 

to move  ; E. coli cells move randomly across the world.
  rt random-float 360
  fd 1
end 

to reproduce    ; E. coli cells reproduce based on % selective advantage when Natural-Selection? is ON.

  ifelse natural-selection? [

    ; we have to use `runresult` here in order to compare, for example, the string "magenta" to the primitive `magenta`
    ifelse color = runresult faster-reproducing-ecoli [

      ; When the natural selection is ON, Faster_reproducing E. coli cells
      ; have higher chance of reproduction based on % selective advantage.
      if random-float 100 > ( 99 - ( selective-advantage / 100 ) ) [
        hatch 1 [rt random-float 360 fd 1]
      ]
    ]
    [
      if random-float 100 > 99 [
        hatch 1 [rt random-float 360 fd 1]
      ]
    ]
  ]
  [
    ask ecolis [    ; When natural selection is OFF, all E. coli cells have same chance of reproducing.
      if random-float 100 > 99 [
        hatch 1 [rt random-float 360 fd 1]
      ]
    ]
  ]
end 

to check-if-dead       ;; random chance of death when the total population exceeds carrying capacity
  if random count ecolis > carrying-capacity [
    die
  ]
end 


; Copyright 2016 Uri Wilensky.
; See Info tab for full copyright and license.

There is only one version of this model, created about 8 years ago by Sugat Dabholkar.

Attached files

File Type Description Last updated
GenEvo 3 Genetic Drift and Natural Selection.png preview Preview for 'GenEvo 3 Genetic Drift and Natural Selection' about 8 years ago, by Sugat Dabholkar Download

This model does not have any ancestors.

This model does not have any descendants.