Speciation mechanisms

Speciation mechanisms preview image

1 collaborator

Screen_shot_2018-02-02_at_12.53.50_pm lin xiang (Author)

Tags

(This model has yet to be categorized with any tags)
Visible to everyone | Changeable by the author
Model was written in NetLogo 6.2.0 • Viewed 433 times • Downloaded 27 times • Run 0 times
Download the 'Speciation mechanisms' 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 module simulates the coloration evolution of a fish population influenced by various factors. You can create a boundary to divide the population, differentiate the environment, as well as adjust various factors, and then observe what happens to the fish color distribution over time. (Refined 15th March 2019)

HOW IT WORKS

First, press on the "setup" button, then press on "run/pause" button to run the simulation. When the simulation starts, you should see a population of fish swimming in a lake, represented by a dark blue background. The fish are given a random age from 0 to 9. Each fish executes the same set of behavioral rules: 1) moving, 2) growth and death, 3) reproduction, and 4) survival.

Rule 1-Moving: Fish swims in the simulated lake. When fish encounters a boundary, it resets its direction and moves away.

Rule 2-Growth and death: Fish's age increases every hypothetic year. The fish older than 20 disappear from the simulation; namely, they die.

Rule 3-Reproduction: In each "year," each female RANDOMLY chooses a male from the adjacent area as the mate and reproduces offspring. Most of the offspring fish's color is the average of their parents. In a chance determined by the slider "mutation-rate," a mutant is produced with either a lighter or darker color in comparison with the average parent color. The female preference is controlled by "strength-of-preference." The higher is the preference strength, the more does the female prefers a male with a color similar to her.

Rule 4-Survival: In this module, the more different is the fish color from the background, the more likely is it to become prey. The slider "number-of-visual-predators" enables you to adjust the strength of predation pressure.

Rule 5-Overpopulation: The maximum capacity of the lake is determined by the slider "max-lake-capacity." If the number of fish exceeds the maximum, every fish has a 50% chance of dying regardless of its gender, age, or color.

HOW TO USE IT

1- Setup the starting conditions of the simulation. By pulling the bar of the corresponding sliders, you may set or adjust five conditions of the simulation.

fish-color-variation:   The initial variation range of fish coloration
heritable-color?        Whether the fish color is heritable
mutation-rate:      The mutation rate of fish population
max-lake-capacity:      The maximum number of fish held by the lake
Dispersal:          Fish's ability to disperse in the lake per year
number-of-visual-predators:     The environment selection rate
Strength-of-mating-preference:  The strength that a female chooses a male with similar color

2- After setting the starting conditions press the "set up/Reset" button.

3- Press the "Run/Pause" button to continuously run the simulation or pause it. Press the "Run by clicking" if you want to run simulation year by year.

4- While running the simulation, you may either 1) press the "Isolate population" button to create boundaries to divide the simulation window into upper and lower areas, or 2) press the "differentiate environments" button to set different environment colors for the upper and lower areas, or 3) press both buttons to introduce both situations at the same time.

5-You may take off boundaries and/or recover the background by pressing the "Resemble populations" button.

6-You may adjust different factor(s) while running the simulation to investigate the impact on fish color divergence.

Related Models

Find related models at http://3dsciencemodeling.com

CREDITS AND REFERENCES

This module is made by Dr. Lin Xiang at the University of Kentucky. If you mention this model in a publication, we ask that you include the citations below.

Xiang, L. (2017). Speciation mechanisms. Department of STEM Education, University of Kentucky, Lexington, KY.

CC BY-NC-SA 4.0

This work is licensed under the Creative Commons Attribution-NonCommercial-ShareAlike 4.0 License. To view a copy of this license, visit https://creativecommons.org/licenses/by-nc-sa/4.0/.

Comments and Questions

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

Click to Run Model

;;;;;;;;;;;;;set breeds and global variables;;;;;;;;;;
breed [females female]
breed [males male]


turtles-own [age]
globals [
  attribute
  isolation?
         environ?
          iso-position ]


;;;;;;;;;;;;;reporter;;;;;;;;;;;;;;;;;;

to-report years
  report ticks / 100
end 

to-report front-color
  report [pcolor] of (patch-ahead 1)
end 

to-report upper-tt-color
ifelse any? turtles with [ycor > iso-position] [report mean [color] of turtles with [ycor > iso-position]][report 0]
end 

to-report down-tt-color
ifelse any? turtles with [ycor < iso-position] [report mean [color] of turtles with [ycor < iso-position]][report 0]
end 

to-report diff-bk
report abs (color - pcolor)
end 

;to-report max-tt
;report (max-pxcor * max-pycor)
;end


;;;;;;;;;;;;;;;;;set up;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

to reset
 set Number-of-visual-predators 0
 set heritable-color? true
 set Initial-fish-color-variation 7
 set mutation-rate 1
 set Strength-of-mating-preference 0
 set Dispersal 0.01
end 

to setup
clear-all
set iso-position 0
setup-patches

set-default-shape females "fish-2"
set-default-shape males "fish-2"
create-females 50
[set size 1.75
 set color 81 + random-float Initial-fish-color-variation
 set age random 10
 setup-position]
create-males 50
[set size 1.75
 set color 81 + random-float Initial-fish-color-variation
 set age random 10
 setup-position]

set isolation? false
set environ? false
reset-ticks
do-plot1
;do-plots
end 

to setup-patches
ask patches [set pcolor 82.5]
;ask patches with [abs pxcor = max-pxcor]  [set pcolor 35]
;ask patches with [abs pycor = max-pycor]  [set pcolor 35]
end 

to setup-position
setxy random-xcor random-ycor
if pcolor = 35
[setup-position]
end 

to set-isolation
ask patches [if (abs pycor = max-pycor) or (abs pxcor = max-pxcor) or (pycor = iso-position) or (pycor = iso-position - 1 ) or (pycor = iso-position )  [set pcolor 35]]
set isolation? true
;do-plots
end 

to set-environ
ask patches
[if isolation? [if abs pxcor < max-pxcor and abs pycor < max-pycor and pycor > iso-position    [set pcolor 87.5]
                if abs pxcor < max-pxcor and abs pycor < max-pycor and pycor < iso-position - 1   [set pcolor 82.5]]]
set environ? true
end 

to set-environ-1
ask patches
[if abs pxcor <= max-pxcor and abs pycor <= max-pycor and pycor >= iso-position    [set pcolor 87.5]
                if abs pxcor <= max-pxcor and abs pycor <= max-pycor and pycor <= iso-position - 1   [set pcolor 82.5]]
set environ? true
end 

to initial
setup-patches
set isolation? false
set environ? false
if abs (upper-tt-color - down-tt-color) > 3.5
[let mid-color (upper-tt-color + down-tt-color) / 2
  ask turtles with [color > (mid-color - 1.75) and color < (mid-color + 1.75 )] [die]]
end 


;;;;;;;;;;;;;go;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

to go
  tick

if (count turtles > max-lake-capacity * 3) or (not any? turtles) [stop]

ask turtles
[move
  if pcolor = 35 [die]]
growth
mating
over-repro
diff-survival
if ticks > years-to-run * 100  [user-message "The year has reached the defined value. Click 'setup' to restart the experiment or extend the number of years." stop]

if isolation? [if (count turtles with [pycor > iso-position]) = 0 [user-message "One of the subpopulation has gone extinct." stop]
               if (count turtles with [pycor < iso-position]) = 0 [user-message "One of the subpopulation has gone extinct." stop]
                              ]

;if isolation? [do-plots]
do-plot1
end 

to diff-survival
ask turtles
 [if random 20 = 0 [if random-float 1000 < (diff-bk * Number-of-visual-predators * 0.5) ^ 2  [die]]]
end 

to move
    ifelse front-color = 35 [rt random 360]
                            [ifelse random 50 = 0 [rt random 90 lt random 90 ifelse front-color = 35 [rt random 360]
                                                                                                 [;fd 0.05
                                                                                                   fd Dispersal]]
                                              [;fd 0.05
                                                fd Dispersal]]
end 

to growth
ask turtles
[ifelse age > 20
  [die]
  [set age age + 0.01]
  if pcolor = 35 [die]]
end 

to mating
ask females with [age > 1]
[if random 30 = 0

[let partner one-of males-on neighbors                     ;;find a male adult turtle here
   if (partner != nobody) and ([age] of partner > 1) and (abs (color - [color] of partner) <= (3.5 - Strength-of-mating-preference))      ;;if there is one and same species
       [ifelse random 2 = 0
         [hatch-females 1 [ifelse heritable-color?
                           [set age 0
                           ifelse random-float 200 < mutation-rate [ifelse random 2 = 0 [set color ((color + [color] of partner) / 2) + random-float 2]
                                                                                        [set color ((color + [color] of partner) / 2) - random-float 2] ]
                                                                   [set color (color + [color] of partner) / 2]
                           if color >= 89 [set color 88.5]
                           if color <= 81 [set color 81.5]
                                 ]
                           [set age 0 set color 81 + random-float Initial-fish-color-variation]
                           move
                           ]]
         [hatch-males 1 [ifelse heritable-color?
                          [set age 0
                         ifelse random-float 200 < mutation-rate [ifelse random 2 = 0 [set color ((color + [color] of partner) / 2) + random-float 2]
                                                                                      [set color ((color + [color] of partner) / 2) - random-float 2] ]
                                                                 [set color (color + [color] of partner) / 2]
                         if color >= 89 [set color 88.5]
                         if color <= 81 [set color 81.5]
                           ]
                          [set age 0 set color 81 + random-float Initial-fish-color-variation]
                        move
                         ]]]]
  ]
end 

to over-repro
ifelse (isolation? or environ?) ;if barrier or different environments, no compete between different geo population
       [ask turtles with [ycor > iso-position]
             [if count turtles with [ycor > iso-position] > (max-lake-capacity / 2) [if random 2 = 0 [die]]]
        ask turtles with [ycor < iso-position]
             [if count turtles with [ycor <= iso-position] > (max-lake-capacity / 2) [if random 2 = 0 [die]]]]
       [ask turtles [if count turtles > max-lake-capacity [if random 2 = 0 [die]]]]
ifelse (Strength-of-mating-preference > 0)               ;if sexual selection, no compete between different color population
       [ask turtles with [color > 84.5]
         [if count turtles with [color > 84.5] > (max-lake-capacity / 2) [if random 2 = 0 [die]]]
        ask turtles with [color <= 84.5]
         [if count turtles with [color <= 84.5] > (max-lake-capacity / 2) [if random 2 = 0 [die]]]]
       [ask turtles [if count turtles > max-lake-capacity [if random 2 = 0 [die]]]]
end 

to do-plots
set-current-plot "Average Fish Colors in Upper & Lower Areas"
set-current-plot-pen "upper area"
plot upper-tt-color
set-current-plot-pen "lower area"
plot down-tt-color
end 

to do-plot1
set-current-plot "Fish Color Distribution"
set-plot-x-range 80 90
set-plot-y-range 0 round (count turtles / 5)
histogram [color] of turtles
end 

;Developed by Lin Xiang  contact info:lin.xiang@uky.edu

There are 3 versions of this model.

Uploaded by When Description Download
lin xiang almost 3 years ago update license Download this version
lin xiang almost 4 years ago agent watching Download this version
lin xiang about 4 years ago Initial upload Download this version

Attached files

File Type Description Last updated
Speciation mechanisms.png preview Preview for 'Speciation mechanisms' about 4 years ago, by lin xiang Download

This model does not have any ancestors.

This model does not have any descendants.