; Carter Merentein ; Final Project patches-own [ ; ---- general ----- land? ; where turtles can walk food? ; used to control the population. ; -- - island ----- water? ; turtles cannot walk on water island-number ; used in the reporter that compares similarity, in order to differentiate between turtles of each island. ; ---- sympatric --- red-flowers? ; turtles mate on different color flowers yellow-flowers? ; turtles mate on different color flowers ] turtles-own [ age ; controls life cycle mating? ; prevents turtles from having multiple mating partners. Turtes that are mating cannont make a new mating partner. mating-partner ; used for genome combination genome ; a list of random integers. All of them start off as all 0s. The spesific integers mean nothing energy ; used as population control, repated to food? generation ; each new turtle has its generation incrimented. ] globals [ ; ---- Island ----- island-turtles ; initial number of turtles island-xcor ; xcor of island island-ycor ; ycor of island island-radius ; radius of island ; ---- general ---- sample-size ; used in comparing genomes max-age ; oldest possible age of a turtle maturity ; youngest age that a turtle can mate food-regrowth-rate ; chance a given patch without food regrows it p-mutation ; chance a turtle's genome is randomply mutated min-similarity ; the minimum degree of similairity between two turtles after which they are different species ; ---- sympatric ---- sympatric-turtles ; starting number of turtles for sympatric setup (should be much larger than for island) ; p-red-flowers ; chacne a patch grows red flowers (initialized with slider) ; p-yellow-flowers ; chance a patch grows yellow flowers (initialized with slider) ] breed [rojos rojo ] ; turtles that mate on red flowers breed [amarillos amarillo] ; trutles that mate on yellow flowers ; /\/\/\/\/\/\/\/\/\/\/\/\/\\/\/\/\/\/\/\/\/\/ GENERAL SETUP /\/\/\/\/\/\/\/\/\/\/\/\/\\/\/\/\/\/\/\/\/\/ ; setup is the same for all modes to setup ca init-standard-globals init-patches init-turtles reset-ticks end ; goes to setups for different modes to init-patches if mode = "island" [init-islands] if mode = "custom setup" [all-land-setup] if mode = "sympatric" [sympatric-setup] end ; sets up turtles for different modes to init-turtles if mode = "island" [init-island-turtles] end ; initalizes the globals that are used in all modes to init-standard-globals set sample-size 50 set max-age 20 set maturity 6 set food-regrowth-rate .5 set p-mutation .0001 set min-similarity 0.5 end ; runs until the populations have diverged genetically so that they have no similarity. ; the repeat 3 is used because compare-islands is based on a random sample of turtles, and repeating for 3 samples ; makes sure that more of the turtles have completely diverged. to island-speciation repeat 3 [while [compare-islands != 0] [go]] end ; both the island and custom use the island setup, because the custom mode relies on boundries rather than behavior, ; so it is demonstrating the same type of speciation as the island setup to go if mode = "island" [island-go] if mode = "custom setup" [island-go] if mode = "sympatric" [sympatric-go] tick end ;/\/\/\/\/\/\/\/\/\/\/\/\/\\/\/\/\/\/\/\/\/\/ ISLAND SETUP /\/\/\/\/\/\/\/\/\/\/\/\/\\/\/\/\/\/\/\/\/\/ ; creates two islands, used for showing allpatric speciation to init-islands init-island-globals ask patches [ set food? true set water? true set land? false set red-flowers? false set yellow-flowers? false ] make-island island-xcor island-ycor island-radius 1 make-island 0 - island-xcor 0 - island-ycor island-radius 2 land-water-color end ; initializes globals spesific to the island setup to init-island-globals set island-turtles 200 set island-xcor 8 set island-ycor 8 set island-radius 8 end ; creates a circle of patches with the given coordinates and radius that have land? = true and food? = true to make-island [ center-xcor center-ycor radius island] ask patch center-xcor center-ycor [ set water? false set land? true ask patches in-radius radius [ set water? false set land? true set island-number island ] ] end ; makes water blue, makes land green to land-water-color ask patches [ ifelse land? [set pcolor green] [set pcolor blue] ] end ; creates island-turtles new turtles on each island to init-island-turtles crt island-turtles [ setxy island-xcor island-ycor init-island-turtle-nonunique-variables ] crt island-turtles [ setxy 0 - island-xcor 0 - island-ycor init-island-turtle-nonunique-variables ] end ; stores all of the initial commands for turtles besides which island they are on to init-island-turtle-nonunique-variables set age random max-age set color brown set heading random 361 fd random-float island-radius set mating? false set mating-partner nobody set energy 3 set genome [0 0 0 0 0 0 0 0 0 0] set generation 0 end ; /\/\/\/\/\/\/\/\/\/\/\/\/\\/\/\/\/\/\/\/\/\/ SYMPATRIC SETUP /\/\/\/\/\/\/\/\/\/\/\/\/\\/\/\/\/\/\/\/\/\/ ; sympatric uses an all land setup with some flowers. It also uses two breeds, explained below. to sympatric-setup init-sympatric-globals all-land-setup setup-flowers init-sympatric-turtles end ; A certain amount of patches are designated as flowers, either red or yellow. A patch cannot be both. to setup-flowers ask patches [ if random-float 1.0 < p-red-flowers [ set red-flowers? true set yellow-flowers? false set food? false ] if random-float 1.0 < p-yellow-flowers[ ifelse red-flowers? and random-float 1.0 < .5 ; this makes sure that, although reds are made first, neither is "dominant" [] [ set yellow-flowers? true set red-flowers? false set food? false] ] ] color-flowers end ; Shockingly, patches with red-flowers are colored red, and yellow-flowers are yellow. to color-flowers ask patches with [red-flowers?] [set pcolor red] ask patches with [yellow-flowers?] [set pcolor yellow] end ; The other two globals are initialized with sliders to init-sympatric-globals set sympatric-turtles 300 end ; Two breeds are used to control mating-habit preferences. This pre-determines that eventually each breed will diverge ; genetically, because each breed starts behaiorally isolated. Breeds are named from the Spanish name of the color they prefer. ; Because the sympatric mode requires comparing genomes far more turtles than the island mode does, the genomes are smaller. to init-sympatric-turtles create-rojos sympatric-turtles [ setxy random-xcor random-ycor set color brown set mating? false set mating-partner nobody set energy 3 set genome [0 0 0 0 0 0] set generation 0 ] create-amarillos sympatric-turtles [ setxy random-xcor random-ycor set color brown set mating? false set mating-partner nobody set energy 3 set genome [0 0 0 0 0 0] set generation 0 ] end ; /\/\/\/\/\/\/\/\/\/\/\/\/\\/\/\/\/\/\/\/\/\/ GENERAL PROCEDURES /\/\/\/\/\/\/\/\/\/\/\/\/\\/\/\/\/\/\/\/\/\/ ; changes one item in a turtle's genome to a random integer to mutate ask turtles [ if random-float 1.0 <= p-mutation [ set genome replace-item random (length [genome] of one-of turtles) genome random 100000 ; show "mutation!" ] ] end ; Turtles have increased probability of dying as they approach max-age. All of them die by age = max-age ; Turtles also die if their energy gets to 0 to turtles-die ask turtles [ ; show "arrgh" if random-float 1.0 <= .50 ^ (max-age - age) [;show "old" die] if energy = 0 [;show "starving" die] ] end ; Land patches with food are green, those without are brown to food-color ask patches with [land? and not red-flowers? and not yellow-flowers?] [ ifelse food?[set pcolor green] [set pcolor brown + 3] ] end ; Each turn patches without food have a chance to change to having food. This probability is based on food-regrowth-rate to regrow-food ask patches with [not food? and not red-flowers? and not yellow-flowers?] [ if random-float 1.0 < food-regrowth-rate [set food? true] ] end ; Because these turtles are not gender spesific, both turtles in a mating pair reproduce. Each one hatches 0, 1 or 2 new turtles ; The new turtle's genome is based on eah parent. Each term in the new turtle is based on that number term in the parents. ; If that term in the parents are different, the offspring gets the higher of the two. to reproduce ask turtles [ if mating? [ hatch random 3 [ ; show self ; show mating-partner set energy 3 set age 0 set mating? false let i 0 while [i < length (genome)] [ set genome replace-item i genome max list (item i genome) (item i [genome] of mating-partner) set i i + 1 ] ; show genome set mating-partner nobody set generation generation + 1 ] set mating? false set mating-partner nobody] ] end ; turtles that have the tracer sequence are colored red. to color-traced ask turtles with [tracer?] [ set color red] end ; All the turtles that a given turtle can mate with are colored magenta. to highlight-species show "Click on a turtle" let sample select-turtle foreach species sample [ask ? [set color 125]] end ; /\/\/\/\/\/\/\/\/\/\/\/\/\\/\/\/\/\/\/\/\/\/ ISLAND GO /\/\/\/\/\/\/\/\/\/\/\/\/\\/\/\/\/\/\/\/\/\/ ; Turtles mutate, move, then made. Patches recolor, then regrow at the end of the time period. Turtles also age by 1 each turn. to island-go mutate island-movement food-color island-find-mate reproduce ; the reproduce procedure can be found above in the general procedures section ask turtles [set age age + 1] turtles-die regrow-food color-traced end ; Turtles move randomly, slightly favoring forward motion. If there is water ahead of them they make right turns until there is land ahead to island-movement ask turtles [ rt 90 - random 181 while [[water?] of patch-ahead 1] [ rt 15 ] fd 1 if food? [ set energy energy + 3 ask patch-here [set food? false] ] set energy energy - 1 ] end ; Mature turtles select one other turtle on the same patch and set turtle as its mating-partner. It sets itself as that other turtle's mating-partner ; It sets mating? true for both turtles. If there are no mature turtles who aren't mating on their patch, they don't mate/ to island-find-mate ask turtles with [age >= maturity] [ if any? other turtles-here with [age >= maturity and not mating?] [ set mating? true set mating-partner one-of other turtles-here with [age >= maturity and not mating?] ; show mating-partner ask mating-partner [ set mating? true set mating-partner myself] ; show mating-partner ] ] end ; /\/\/\/\/\/\/\/\/\/\/\/\/\\/\/\/\/\/\/\/\/\/ SYMPATRIC GO /\/\/\/\/\/\/\/\/\/\/\/\/\\/\/\/\/\/\/\/\/\/ ; Similar to island-go in the general structure. Unique versions of procedures are marked with sympatric- at the start to sympatric-go mutate sympatric-movement food-color sympatric-find-mate reproduce ; the reproduce procedure can be found in the general procedures section ask turtles [set age age + 1] turtles-die renew-landscape color-traced end ; Mature turtles seek out flowers to mate on. Immature wander randomly.There is a slight difference in "random" movement. ; Turtles here favor smaller angles, rather than actually randomly picking a turn between -90 an 90. This is because ; there is more space they need to move, and so movement needs to encourage more forward movement in order to have a ; well mixed population. to sympatric-movement ask rojos with [age >= maturity] [ if not red-flowers?[ set heading towards closest-red-flower fd 1 ] ] ask amarillos with [age >= maturity] [ if not yellow-flowers? [ set heading towards closest-yellow-flower fd 1 ] ] ask turtles with [age < maturity][ rt 91 lt 91 fd 1 if food? [ set energy energy + 1 ; note: energy is lower here than in island-movement, to control population size ask patch-here [set food? false] ] set energy energy - 1 ] end ; Generally the same as island-find-mate, except they only look for a mate when they are on the right kind of flower. to sympatric-find-mate ask rojos with [age >= maturity] [ if red-flowers? [ if any? other rojos-here with [age >= maturity and not mating?] [ set mating-partner one-of other rojos-here with [age >= maturity and not mating?] ask mating-partner [ set mating-partner myself set mating? true] ] ] ] ask amarillos with [age >= maturity] [ if yellow-flowers? [ if any? other amarillos-here with [age >= maturity and not mating?] [ set mating-partner one-of other amarillos-here with [age >= maturity and not mating?] ask mating-partner [ set mating-partner myself set mating? true] ] ] ] end ; clears flowers and generates new ones. Also regrows all food. to renew-landscape ask patches [ set red-flowers? false set yellow-flowers? false set food? true if random-float 1.0 < p-red-flowers [ set red-flowers? true set yellow-flowers? false set food? false ] if random-float 1.0 < p-yellow-flowers[ ifelse red-flowers? and random-float 1.0 < .5 [] [ set yellow-flowers? true set red-flowers? false set food? false] ] ] color-flowers end ; This uses output and color-coding in order to demonstrate sympatric speciation. There are 3 stages: first, running the ; go procedure enough times so that some turtles are different enough that they cannot mate with each other. Next. once ; some sub-species has arisen, this is shown graphically to the user, and explained with text. Finally, the go procedure is ; ran again until the two species have entirely diverged. This is not actually measured, because testing to ensure that ; a species is not a ring species is very slow, but through experimentation it was found that after 400 ticks there will ; never still be a ring species (and even if there were, I don't think this will take away from the educational value). to sympatric-presentation output-print "This will show how behavioral" output-print "differences can lead to isolation" output-print "and then speciation" while [ticks < 100] [go] ; for the first hundred ticks, there is not enough time for speciation, so no point in testing let sample one-of turtles while [(count turtles) - (length species sample) < (count turtles / 10)] ;essentially, while almost everyone can still mate with almost anyone [ go set sample one-of turtles] let mate-list species sample let all-turtles sort turtles let cant-mate all-turtles foreach mate-list [set cant-mate remove ? cant-mate] color-species mate-list ask sample [set color black set size 4] display clear-output output-print "Look! the white turtles are all of" output-print "the turtles that the black one cannot" output-print "mate with. This would mean that they" output-print "are different species." wait 13 clear-output output-print "But, speciation is not that simple" output-print "What happens if we expand our sample" output-print "to turtles that can mate with turtles" output-print "that our original can mate with?" wait 3 repeat 10 [ ; Doing it only once has the risk of not changing mating-list very much, more than 10 or so is redundant set sample one-of mate-list foreach species sample [set mate-list fput ? mate-list] set mate-list remove-duplicates mate-list foreach mate-list [set cant-mate remove ? cant-mate] color-species mate-list ] display output-print "Many more turtles are now able to" output-print "exchange genetic material with our" output-print "first turtle. If we continued this" output-print "we would find that all turtles" output-print "can still exchange genetic material." output-print "This is called a ring species." wait 10 clear-output ask turtles [set color brown set size 1] display ; the set size 1 is to reset the sample output-print "Let's continue running." while [ticks < 400] [go] set sample one-of turtles set mate-list species sample set cant-mate all-turtles foreach mate-list [set cant-mate remove ? cant-mate] color-species mate-list clear-output output-print "Now, we have two clearly defined" output-print "species. None of the white turtles" output-print "can mate with any of the brown ones." end ; turtles in the species are brown, turtles out are white. ; times within one tick. to color-species [mate-list] ask turtles [set color white] foreach mate-list [ask ? [set color brown]] end ; /\/\/\/\/\/\/\/\/\/\/\/\/\\/\/\/\/\/\/\/\/\/ GENERAL REPORTERS /\/\/\/\/\/\/\/\/\/\/\/\/\\/\/\/\/\/\/\/\/\/ ; takes two lists of turtles, and compares their genomes. Reports a list of boolean values for each comparison made between ; the genomes of every turtle. to-report similarity [list1 list2] let compared-terms [] let i-a 0 let i-b 0 while [i-b < length list1] [ while [i-a < length [genome] of one-of turtles] [ let new-compared-terms (map [item i-a [genome] of ?1 = item i-a [genome] of item i-b list2 ] list1) foreach new-compared-terms [set compared-terms fput ?1 compared-terms] set i-a i-a + 1 ; show compared-terms ] set i-b i-b + 1 set i-a 0 ] report compared-terms end ; takes a list compared-terms and reports what fraction of that is true to-report similarity-fraction [compared-terms] let similar-terms filter [? = true] compared-terms ; show similar-terms let fraction-similar length similar-terms / length compared-terms report fraction-similar end to-report individual-similarity [turtle-1 turtle-2] let list1 (list(turtle-1)) let list2 (list(turtle-2)) report similarity-fraction (similarity list1 list2) end ; reports the average generation of turtles. Not used by turtles, but useful for the user to-report avg-generation report mean [generation] of turtles end ; if a turtle has the tracer sequence, it is reported to-report tracer? ifelse item 0 genome = tracer-sequence [report true] [report false] end to-report select-turtle while [not mouse-down?] [] while [mouse-down?] [ ifelse any? turtles with [distancexy mouse-xcor mouse-ycor < 2] [ report min-one-of turtles [distancexy mouse-xcor mouse-ycor]] [report false] ] end ; /\/\/\/\/\/\/\/\/\/\/\/\/\\/\/\/\/\/\/\/\/\/ ISLAND REPORTERS /\/\/\/\/\/\/\/\/\/\/\/\/\\/\/\/\/\/\/\/\/\/ ; reports the similarity between two lists of 50 turtles from each island to-report compare-islands let island1-sample sort n-of sample-size turtles with [island-number = 1] let island2-sample sort n-of sample-size turtles with [island-number = 2] report similarity-fraction (similarity island1-sample island2-sample) end ; Reports the similarity within one island (spesifically island 1, but this can be changed for the final project if it is used) to-report internal-similarity let list1 sort n-of (sample-size * 2) (turtles with [island-number = 1]) let list2 sublist list1 0 sample-size set list1 sublist list1 sample-size (sample-size * 2) report similarity-fraction (similarity list1 list2) end ; /\/\/\/\/\/\/\/\/\/\/\/\/\\/\/\/\/\/\/\/\/\/ SYMPATRIC SPECIATION REPORTERS /\/\/\/\/\/\/\/\/\/\/\/\/\\/\/\/\/\/\/\/\/\/ ; If two trutles are too different, they cannot mate to-report can-mate? [turtle-1 turtle-2] ifelse individual-similarity turtle-1 turtle-2 > min-similarity [report true] [report false] end ; Returns a list of all turtles that the given turtle can mate with. to-report species [turtle-1] let all-turtles sort turtles set all-turtles remove turtle-1 all-turtles let species-list [] foreach all-turtles [if can-mate? turtle-1 ? [set species-list fput ? species-list]] report species-list end ; reports the closest patch with red flowers. It iteratively checks greater and greater radii for the closest one ; there is some redundancy with what it checks, but this is still faster than just asking all patches at once, ; excluding cases of extremely low densities. to-report closest-red-flower let i 1 while [i < 23] [ if any? patches with [red-flowers?] in-radius i [report min-one-of patches in-radius i with [red-flowers?] [distance myself]] set i i + 1 ] report false end ; same as closest-red-flower but for yellow flowers to-report closest-yellow-flower let i 1 while [i < 23] [ if any? patches with [yellow-flowers?] in-radius i [report min-one-of patches in-radius i with [yellow-flowers?] [distance myself]] set i i + 1 ] report false end ; /\/\/\/\/\/\/\/\/\/\/\/\/\\/\/\/\/\/\/\/\/\/ DRAWING MODE /\/\/\/\/\/\/\/\/\/\/\/\/\\/\/\/\/\/\/\/\/\/ ; Creates a setup of only land patches, with all food? true. to all-land-setup ask patches [ set land? true set water? false set food? true set red-flowers? false set yellow-flowers? false ] land-water-color end ; Lets user change patches to water, and recolors. Useful for experimenting with boundaries and isolation to draw-water while [not mouse-down?] [] while [mouse-down?] [ ask patch mouse-xcor mouse-ycor [ set water? true set land? false set pcolor blue ] ] end ; Lets user change patches to land, with food. Useful for experimenting with different amounds of isolation to draw-land while [not mouse-down?] [] while [mouse-down?] [ ask patch mouse-xcor mouse-ycor [ set water? false set land? true set food? true set pcolor green ] ] end ; Lets users place new turtles, then disperses them within a certain radius. to place-turtles show "select a patch for the center of the new turtles" let center select-patch crt placed-turtles [ set age random maturity set color brown set mating? false set mating-partner nobody set energy 3 set genome [0 0 0 0 0 0 0 0 0 0] set generation 0 move-to center set heading random 361 fd random-float disperse-radius ] end ; makes a turtle with a certain gene sequence, and marks it red. It also starts with more energy so it doesn't die right away. to place-tracer show "select a patch for the center of the new turtles" let center select-patch crt 1 [ set age random maturity set color red set mating? false set mating-partner nobody set energy 5 set genome [0 0 0 0 0 0 0 0 0] ; note, must be 1 less than regular turtles set genome fput tracer-sequence genome set generation 0 move-to center ] end ; Used for placing turtles in custom mode. to-report select-patch let answer nobody wait .3 while [not mouse-down?] [] while [mouse-down?] [ set answer patch mouse-xcor mouse-ycor ] report answer end @#$#@#$#@ GRAPHICS-WINDOW 210 10 649 470 16 16 13.0 1 10 1 1 1 0 1 1 1 -16 16 -16 16 1 1 1 ticks 30.0 BUTTON 28 31 95 64 NIL setup NIL 1 T OBSERVER NIL NIL NIL NIL 1 BUTTON 104 32 167 65 NIL go T 1 T OBSERVER NIL NIL NIL NIL 1 BUTTON 30 89 171 122 NIL island-speciation NIL 1 T OBSERVER NIL NIL NIL NIL 1 BUTTON 656 79 765 112 NIL draw-water NIL 1 T OBSERVER NIL NIL NIL NIL 1 BUTTON 657 120 755 153 NIL draw-land NIL 1 T OBSERVER NIL NIL NIL NIL 1 PLOT 2 126 202 276 Similarity between islands NIL Similarity 0.0 10.0 0.0 100.0 true false "" "" PENS "default" 1.0 0 -16777216 true "" "if mode = \"island\" [plot compare-islands * 100]" MONITOR 36 280 163 333 NIL internal-similarity 3 1 13 BUTTON 656 39 769 72 NIL place-turtles NIL 1 T OBSERVER NIL NIL NIL NIL 1 INPUTBOX 778 39 860 99 placed-turtles 300 1 0 Number SLIDER 659 165 831 198 disperse-radius disperse-radius 0 32 2 1 1 NIL HORIZONTAL CHOOSER 385 493 523 538 mode mode "island" "custom setup" "sympatric" 2 TEXTBOX 735 15 885 33 Custom Mode 13 0.0 1 TEXTBOX 64 68 137 86 Island Mode 13 0.0 1 TEXTBOX 47 10 197 28 General Procedures 13 0.0 1 BUTTON 668 218 823 251 NIL place-tracer NIL 1 T OBSERVER NIL NIL NIL NIL 1 INPUTBOX 668 262 823 322 tracer-sequence 99999 1 0 Number TEXTBOX 46 354 196 372 Sympatric Mode 13 0.0 1 SLIDER 16 384 188 417 p-red-flowers p-red-flowers 0 1 0.1 .01 1 NIL HORIZONTAL SLIDER 16 424 188 457 p-yellow-flowers p-yellow-flowers 0 1 0.1 .01 1 NIL HORIZONTAL BUTTON 9 468 191 501 NIL sympatric-presentation NIL 1 T OBSERVER NIL NIL NIL NIL 1 OUTPUT 10 511 312 645 12 BUTTON 666 344 807 377 NIL highlight-species NIL 1 T OBSERVER NIL NIL NIL NIL 1 MONITOR 392 564 504 617 NIL avg-generation 3 1 13 @#$#@#$#@ ## WHAT IS IT? This is a set of simulations designed to show how two populations become different species, through a process called speciation. There are two types of speciation: allopatric, which relies of geographical isolation, and sympatric, which relies on behavioral isolation. This simulation uses three different modes to explore speciation: island, costum, and sympatric. ## HOW IT WORKS The basic method this model uses for determining species is the amount of difference in a turtle's genome. Genomes are represented by lists of integers, and they are randomly "mutated" by having items replaced with new random integers. Turtles use sexual reproduction, and each turtle passes on genes to its offspring. In this way, mutations get passed on to future generations, and spread throughout populations. In the custom and island setups, turtles mate randomly with other turtles on the same patch as them. In sympatric, the method is slightly more complicated, and is explained further on. ## ISLAND MODE This mode has two islands, each starting with identical populations of turtles. They carry out the same basic life cycles on each island, but through random mutation and geographical isolation they become increasingly genetically different. The plot to the left shows the average genetic similarity between the populations on the two islands. The internal similarity monitor shows an average genetic similarity within the turtles on the same island. The button island-speciation will run the go procedure until there is zero genetic similarity between the two islands. ## CUSTOM MODE This mode starts with no turtles, and an all land setup. The buttons to the right are used to draw water or land, and place turtles. With this, the user can test different setups to see how speciation works with various setups. Additionally, a tracer can be placed, in order two illustrate how genes travel through populations. The tracer is colored red, and has a given mutation in its genome. The higher the number for the tracer-sequence, the more likely it is to be passed on to the next generation. All turtles with this sequence are then colored red, to show the spread. n.b.: all the custom mode buttons can be used in the island mode as well. ## SYMPATRIC MODE In this mode, not all turtles start identically. Half of the turtles mate only when on red flowers, the other half mate only on yellow flowers. The procedure sympatric-presentation uses color-coding and text output to explain the important concepts of the sympatric mode. ## HOW TO USE IT First, use the chooser below the world to select a mode. Once a mode is selected, the Go and Setup buttons will run the spesific procedures for that mode. The spesifics of each mode are explained above. The button "highlight-species" is used in all modes. It colors all of the turtles that a given turtle (slected by mouse click) can mate with. The avg-generation monitor shows the average generation. Each turtle has a turtles-own variable called generation, and each new turtle has the generation of it's parent, plus one. ## THINGS TO NOTICE / THINGS TO TRY In the island setup, the genetic similarity between the islands decreases at a punctuated rate, sometimes flatlining for many generations. Why does this effect occur? How might the size of a turtle's genome effect the rate of change in similarity, and this punctuation effect? Using the custom drawing tools, notice how much geographical isolation is needed for speciation. By placing a tracer in one population, observe how the gene travels from one to another. In general, total isolation is needed for species to diverge entirely, and genes will eventually make their way from one population to another if they are at all connected. See if it is possible to connect the two islands at all and still have them diverge entirely. In the custom mode, create isolated populations and watch how long it takes them to diverge (either by the highlight-species button or by inspecting turtles). Now, make new isolated populations, varying the starting size, or the area of land they have to move in. How does this affect the rate of speciation? In the sympatric-presentation, a ring species is created. This is where there are some turtles too dissimilar to mate, but they can both mate with some shared set of other turtles. Because of this, their genetic material can mix in future generations, and there is no clearly defined boundery to the species. Is it possible to create such a species using geographical isolation? Why or why not? Increase or decrease the amount of flowers in the speciation procedure. If there are too many or two few of either kind, the turtles that mate on those flowers may all die out. In this case, no speciation will ever be observed, since one type died out entirely. ## EXTENDING THE MODEL In this model, the similarity between turtles does not factor into how they chose a mate (primerily for run time reasons). To the chose-mate procedures, try making a minimum similarity (using the can-mate? reporter) below which turtles will not mate. Does this affect the rate of speciation or how much isolation is required for species to diverge? ## NETLOGO FEATURES This model stores genetic material as lists of integers. Offsprings' genomes are made by taking the larger of the two parents' genes for each possition in the list. Similarity comparisons rely on 'foreach' and 'map' to compare the genomes of lists of turtles, and 'n-of' to take samples of populations, in order to reduce run time. ## CREDITS AND REFERENCES Citation for NetLogo software: Wilensky, U. (1999). NetLogo. http://ccl.northwestern.edu/netlogo/. Center for Connected Learning and Computer-Based Modeling, Northwestern University, Evanston, IL. @#$#@#$#@ default true 0 Polygon -7500403 true true 150 5 40 250 150 205 260 250 airplane true 0 Polygon -7500403 true true 150 0 135 15 120 60 120 105 15 165 15 195 120 180 135 240 105 270 120 285 150 270 180 285 210 270 165 240 180 180 285 195 285 165 180 105 180 60 165 15 arrow true 0 Polygon -7500403 true true 150 0 0 150 105 150 105 293 195 293 195 150 300 150 box false 0 Polygon -7500403 true true 150 285 285 225 285 75 150 135 Polygon -7500403 true true 150 135 15 75 150 15 285 75 Polygon -7500403 true true 15 75 15 225 150 285 150 135 Line -16777216 false 150 285 150 135 Line -16777216 false 150 135 15 75 Line -16777216 false 150 135 285 75 bug true 0 Circle -7500403 true true 96 182 108 Circle -7500403 true true 110 127 80 Circle -7500403 true true 110 75 80 Line -7500403 true 150 100 80 30 Line -7500403 true 150 100 220 30 butterfly true 0 Polygon -7500403 true true 150 165 209 199 225 225 225 255 195 270 165 255 150 240 Polygon -7500403 true true 150 165 89 198 75 225 75 255 105 270 135 255 150 240 Polygon -7500403 true true 139 148 100 105 55 90 25 90 10 105 10 135 25 180 40 195 85 194 139 163 Polygon -7500403 true true 162 150 200 105 245 90 275 90 290 105 290 135 275 180 260 195 215 195 162 165 Polygon -16777216 true false 150 255 135 225 120 150 135 120 150 105 165 120 180 150 165 225 Circle -16777216 true false 135 90 30 Line -16777216 false 150 105 195 60 Line -16777216 false 150 105 105 60 car false 0 Polygon -7500403 true true 300 180 279 164 261 144 240 135 226 132 213 106 203 84 185 63 159 50 135 50 75 60 0 150 0 165 0 225 300 225 300 180 Circle -16777216 true false 180 180 90 Circle -16777216 true false 30 180 90 Polygon -16777216 true false 162 80 132 78 134 135 209 135 194 105 189 96 180 89 Circle -7500403 true true 47 195 58 Circle -7500403 true true 195 195 58 circle false 0 Circle -7500403 true true 0 0 300 circle 2 false 0 Circle -7500403 true true 0 0 300 Circle -16777216 true false 30 30 240 cow false 0 Polygon -7500403 true true 200 193 197 249 179 249 177 196 166 187 140 189 93 191 78 179 72 211 49 209 48 181 37 149 25 120 25 89 45 72 103 84 179 75 198 76 252 64 272 81 293 103 285 121 255 121 242 118 224 167 Polygon -7500403 true true 73 210 86 251 62 249 48 208 Polygon -7500403 true true 25 114 16 195 9 204 23 213 25 200 39 123 cylinder false 0 Circle -7500403 true true 0 0 300 dot false 0 Circle -7500403 true true 90 90 120 face happy false 0 Circle -7500403 true true 8 8 285 Circle -16777216 true false 60 75 60 Circle -16777216 true false 180 75 60 Polygon -16777216 true false 150 255 90 239 62 213 47 191 67 179 90 203 109 218 150 225 192 218 210 203 227 181 251 194 236 217 212 240 face neutral false 0 Circle -7500403 true true 8 7 285 Circle -16777216 true false 60 75 60 Circle -16777216 true false 180 75 60 Rectangle -16777216 true false 60 195 240 225 face sad false 0 Circle -7500403 true true 8 8 285 Circle -16777216 true false 60 75 60 Circle -16777216 true false 180 75 60 Polygon -16777216 true false 150 168 90 184 62 210 47 232 67 244 90 220 109 205 150 198 192 205 210 220 227 242 251 229 236 206 212 183 fish false 0 Polygon -1 true false 44 131 21 87 15 86 0 120 15 150 0 180 13 214 20 212 45 166 Polygon -1 true false 135 195 119 235 95 218 76 210 46 204 60 165 Polygon -1 true false 75 45 83 77 71 103 86 114 166 78 135 60 Polygon -7500403 true true 30 136 151 77 226 81 280 119 292 146 292 160 287 170 270 195 195 210 151 212 30 166 Circle -16777216 true false 215 106 30 flag false 0 Rectangle -7500403 true true 60 15 75 300 Polygon -7500403 true true 90 150 270 90 90 30 Line -7500403 true 75 135 90 135 Line -7500403 true 75 45 90 45 flower false 0 Polygon -10899396 true false 135 120 165 165 180 210 180 240 150 300 165 300 195 240 195 195 165 135 Circle -7500403 true true 85 132 38 Circle -7500403 true true 130 147 38 Circle -7500403 true true 192 85 38 Circle -7500403 true true 85 40 38 Circle -7500403 true true 177 40 38 Circle -7500403 true true 177 132 38 Circle -7500403 true true 70 85 38 Circle -7500403 true true 130 25 38 Circle -7500403 true true 96 51 108 Circle -16777216 true false 113 68 74 Polygon -10899396 true false 189 233 219 188 249 173 279 188 234 218 Polygon -10899396 true false 180 255 150 210 105 210 75 240 135 240 house false 0 Rectangle -7500403 true true 45 120 255 285 Rectangle -16777216 true false 120 210 180 285 Polygon -7500403 true true 15 120 150 15 285 120 Line -16777216 false 30 120 270 120 leaf false 0 Polygon -7500403 true true 150 210 135 195 120 210 60 210 30 195 60 180 60 165 15 135 30 120 15 105 40 104 45 90 60 90 90 105 105 120 120 120 105 60 120 60 135 30 150 15 165 30 180 60 195 60 180 120 195 120 210 105 240 90 255 90 263 104 285 105 270 120 285 135 240 165 240 180 270 195 240 210 180 210 165 195 Polygon -7500403 true true 135 195 135 240 120 255 105 255 105 285 135 285 165 240 165 195 line true 0 Line -7500403 true 150 0 150 300 line half true 0 Line -7500403 true 150 0 150 150 pentagon false 0 Polygon -7500403 true true 150 15 15 120 60 285 240 285 285 120 person false 0 Circle -7500403 true true 110 5 80 Polygon -7500403 true true 105 90 120 195 90 285 105 300 135 300 150 225 165 300 195 300 210 285 180 195 195 90 Rectangle -7500403 true true 127 79 172 94 Polygon -7500403 true true 195 90 240 150 225 180 165 105 Polygon -7500403 true true 105 90 60 150 75 180 135 105 plant false 0 Rectangle -7500403 true true 135 90 165 300 Polygon -7500403 true true 135 255 90 210 45 195 75 255 135 285 Polygon -7500403 true true 165 255 210 210 255 195 225 255 165 285 Polygon -7500403 true true 135 180 90 135 45 120 75 180 135 210 Polygon -7500403 true true 165 180 165 210 225 180 255 120 210 135 Polygon -7500403 true true 135 105 90 60 45 45 75 105 135 135 Polygon -7500403 true true 165 105 165 135 225 105 255 45 210 60 Polygon -7500403 true true 135 90 120 45 150 15 180 45 165 90 sheep false 15 Circle -1 true true 203 65 88 Circle -1 true true 70 65 162 Circle -1 true true 150 105 120 Polygon -7500403 true false 218 120 240 165 255 165 278 120 Circle -7500403 true false 214 72 67 Rectangle -1 true true 164 223 179 298 Polygon -1 true true 45 285 30 285 30 240 15 195 45 210 Circle -1 true true 3 83 150 Rectangle -1 true true 65 221 80 296 Polygon -1 true true 195 285 210 285 210 240 240 210 195 210 Polygon -7500403 true false 276 85 285 105 302 99 294 83 Polygon -7500403 true false 219 85 210 105 193 99 201 83 square false 0 Rectangle -7500403 true true 30 30 270 270 square 2 false 0 Rectangle -7500403 true true 30 30 270 270 Rectangle -16777216 true false 60 60 240 240 star false 0 Polygon -7500403 true true 151 1 185 108 298 108 207 175 242 282 151 216 59 282 94 175 3 108 116 108 target false 0 Circle -7500403 true true 0 0 300 Circle -16777216 true false 30 30 240 Circle -7500403 true true 60 60 180 Circle -16777216 true false 90 90 120 Circle -7500403 true true 120 120 60 tree false 0 Circle -7500403 true true 118 3 94 Rectangle -6459832 true false 120 195 180 300 Circle -7500403 true true 65 21 108 Circle -7500403 true true 116 41 127 Circle -7500403 true true 45 90 120 Circle -7500403 true true 104 74 152 triangle false 0 Polygon -7500403 true true 150 30 15 255 285 255 triangle 2 false 0 Polygon -7500403 true true 150 30 15 255 285 255 Polygon -16777216 true false 151 99 225 223 75 224 truck false 0 Rectangle -7500403 true true 4 45 195 187 Polygon -7500403 true true 296 193 296 150 259 134 244 104 208 104 207 194 Rectangle -1 true false 195 60 195 105 Polygon -16777216 true false 238 112 252 141 219 141 218 112 Circle -16777216 true false 234 174 42 Rectangle -7500403 true true 181 185 214 194 Circle -16777216 true false 144 174 42 Circle -16777216 true false 24 174 42 Circle -7500403 false true 24 174 42 Circle -7500403 false true 144 174 42 Circle -7500403 false true 234 174 42 turtle true 0 Polygon -10899396 true false 215 204 240 233 246 254 228 266 215 252 193 210 Polygon -10899396 true false 195 90 225 75 245 75 260 89 269 108 261 124 240 105 225 105 210 105 Polygon -10899396 true false 105 90 75 75 55 75 40 89 31 108 39 124 60 105 75 105 90 105 Polygon -10899396 true false 132 85 134 64 107 51 108 17 150 2 192 18 192 52 169 65 172 87 Polygon -10899396 true false 85 204 60 233 54 254 72 266 85 252 107 210 Polygon -7500403 true true 119 75 179 75 209 101 224 135 220 225 175 261 128 261 81 224 74 135 88 99 wheel false 0 Circle -7500403 true true 3 3 294 Circle -16777216 true false 30 30 240 Line -7500403 true 150 285 150 15 Line -7500403 true 15 150 285 150 Circle -7500403 true true 120 120 60 Line -7500403 true 216 40 79 269 Line -7500403 true 40 84 269 221 Line -7500403 true 40 216 269 79 Line -7500403 true 84 40 221 269 wolf false 0 Polygon -16777216 true false 253 133 245 131 245 133 Polygon -7500403 true true 2 194 13 197 30 191 38 193 38 205 20 226 20 257 27 265 38 266 40 260 31 253 31 230 60 206 68 198 75 209 66 228 65 243 82 261 84 268 100 267 103 261 77 239 79 231 100 207 98 196 119 201 143 202 160 195 166 210 172 213 173 238 167 251 160 248 154 265 169 264 178 247 186 240 198 260 200 271 217 271 219 262 207 258 195 230 192 198 210 184 227 164 242 144 259 145 284 151 277 141 293 140 299 134 297 127 273 119 270 105 Polygon -7500403 true true -1 195 14 180 36 166 40 153 53 140 82 131 134 133 159 126 188 115 227 108 236 102 238 98 268 86 269 92 281 87 269 103 269 113 x false 0 Polygon -7500403 true true 270 75 225 30 30 225 75 270 Polygon -7500403 true true 30 75 75 30 270 225 225 270 @#$#@#$#@ NetLogo 5.0.3 @#$#@#$#@ @#$#@#$#@ @#$#@#$#@ @#$#@#$#@ @#$#@#$#@ default 0.0 -0.2 0 1.0 0.0 0.0 1 1.0 0.0 0.2 0 1.0 0.0 link direction true 0 Line -7500403 true 150 150 90 180 Line -7500403 true 150 150 210 180 @#$#@#$#@ 0 @#$#@#$#@