📄 ---pepperedmothsd.nlogo
字号:
318419396468Yearyears01SLIDER21260280293selectionselection0.0100.080.01.01NILMONITOR441419522468Total Mothslight-moths + dark-moths01BUTTON129467127pollutepollute-worldNIL1TOBSERVERBUTTON7394131127clean upclean-up-worldNIL1TOBSERVERMONITOR547419632468Pollution (%)100 * darkness / 811SLIDER23151279184speedspeed1.0251.50.51NILSWITCH1423129364cycle-pollution?cycle-pollution?11-1000SLIDER18316281349moth-growthmoth-growth110611NILTEXTBOX94188228206Starting PopulationTEXTBOX100242190260Predation RateTEXTBOX99296189314Reproduction RateTEXTBOX431013328Control PanelTEXTBOX7931588333View DataMONITOR698413792462Light Mothslight-moths31MONITOR841413934462Dark Mothsdark-moths31TEXTBOX97133211151Speed of SimulationTEXTBOX1411030028Population Cycle (0% -100%)SWITCH14294295127historical-pollution?historical-pollution?01-1000TEXTBOX287111889Pollution ControlsTEXTBOX1557128689Historical Pollution Cycle @#$#@#$#@WHAT IS IT?-----------This project models a classic example of natural selection - the peppered moths of Manchester, England. The peppered moths use their coloration as camouflage from the birds that would eat them. (Note that in this model, the birds act invisibly.) Historically, light-colored moths predominated because they blended in well against the white bark of the trees they rested on.However, due to the intense pollution caused by the Industrial Revolution, Manchester's trees became discolored with soot, and the light-colored moths began to stick out, while the dark-colored moths blended in. Consequently, the darker moths began to predominate.Now, in the past few decades, pollution controls have helped clean up the environment, and the trees are returning to their original color. Hence, the lighter moths are once again thriving at expense of their darker cousins.This model simulates these environmental changes, and how a population of moths, initially of all different colors, changes under the pressures of natural selection.** This model has been edited to become more realistic. Some of this information no longer applies to the model.Also many more functions have been added to the model itself. ** HOW TO USE IT-------------The NUM-MOTHS slider controls how many moths are initially present in the world. Their coloration is randomly distributed over the possible colors of the world (white to black). Simply select how many moths you'd like to begin with (around 200 is good), and press the SETUP button. Then press the GO button to begin the simulation.The SELECTION slider determines how moths are harvested by the birds that feed on them. SELECTION wraps up nicely many factors that determine the survivability of a species - how many birds there are, how hungry they are, and just how important camouflage is to escaping predation. SELECTION provides a probabilistic window - the lower the level of the slider, the wider this window. At 0, a moth's color ceases to matter. At 100, a moth needs to be perfectly camouflaged to avoid being seen (and thus devoured). You might first try running the model with SELECTION set to around 50.The POLLUTE and CLEAN UP once-buttons, along with the CYCLE-POLLUTION? switch, control the pollution levels in the environment. To watch the cycle described above - from clean environment to industrial revolution to pollution control - set CYCLE-POLLUTION? to on. To directly manipulate the pollution levels in the environment, set CYCLE-POLLUTION? to off, and use the POLLUTE and CLEAN UP buttons to add and remove pollution from the invironment.The SPEED slider controls just how rapidly pollution levels change. As you might guess, 1 is slow, and 100 is fast. A good speed to start with is 10.Finally, 'Peppered Moths' uses six monitors, all of which are straightforward. TICKS reports how much time has elapsed. TOTAL MOTHS displays how many moths are present in the world. LIGHT MOTHS, MEDIUM MOTHS, and DARK MOTHS report the total numbers of moths with each color gradation. The moth population is just divided into thirds over the range of colors. POLLUTION reports the pollution level in the environment on a scale from 0% (no pollution) to 100% (maximum pollution).THINGS TO NOTICE----------------The most important thing to watch is how the entire set of moths seems to change color over time. Let the model run by itself the first time - watch the world change from white to black back to white. Then see how manipulating the sliders effects the populations of moths.Notice that during the first few initial time-steps, the moth population booms. You might then see the moth population fluctuate between different levels, some of which are quite large. The moths give birth to many offspring, but the world in which they live is finite - it has finite space and resources. If the population exceeds the available resources (carrying capacity), the moths tend die a lot faster than they would otherwise. Under normal circumstances, the average population will tend to stay constant, at a level dependent on the speed and selection rates.Watch what happens when a drastic change in the environment occurs. (You can force this with the POLLUTE-WORLD and CLEAN-UP-WORLD buttons.) Can you kill off all of the moths in a matter of a few time-steps?You can watch the ratios between the types of moths change either in the monitors, or graphically in the plot. The yellow line represents the lighter-colored moths, the green line represents the intermediate moths, and the blue line represents the darker-colored moths.THINGS TO TRY-------------How do different levels of mutation and selection change the population? How does the speed of the model effect the rate at which the moths change? Is there a speed at which the moths can't keep up, i.e. the world changes faster than small pockets of discolored moths or mutants can help keep the population up to size?The upper-bound for the moth population is defined as a global variable, 'upper-bound'. It is initially set to 4 * the moth population, but you can change it and watch what happens.EXTENDING THE MODEL-------------------'Peppered Moths' is a nice introduction into modeling genetic and evolutionary phenomena. The code is fairly simple, and divided up into several small procedures that handle the different stages of each generation. This makes it easy for other extensions to be added to the model.Each moth has one gene that effectively determines its survivability under current conditions. This is a turtle variable, simply the turtle's color. Add the concept of the recessive gene to 'Peppered Moths'- each moth might have two color genes (additional turtle variables), that together determine its color. Moths will then need to seek out mates, and use sexual reproduction as opposed to the unnatural asexual reproduction we see here.** This addition has been done: Moths no longer "mutate", instead they have 2 alleles which, when they mate, are combined to determine the offsprings' colors. Also, once a female has mated they can no longer mate, but a male may mate multiple times. ** NETLOGO FEATURES-----------------Note that all of the commands given to the moths are in a block of code that begins 'ask moths [...]'. This is because each moth is given a breed, 'moths'. This makes the code far easier to modify, especially if you want to add a different kind of animal, say, the birds that eat the moths. You would then add a new breed, 'birds', and put all code that birds are to execute in the body of 'ask birds [...]'.CREDITS AND REFERENCES----------------------The peppered moths of Manchester, England as a case study in natural selection were originally studied by British scientist H. B. D. Kettlewell.In 1998, Michael Majerus of the University of Cambridge re-examined Kettlewell's work and found that though his experimental design was questionable in some respects, his conclusions were likely correct nonetheless. In any case, the mechanism of natural selection illustrated by this model is not in doubt.To refer to this model in academic publications, please use: Wilensky, U. (1998). NetLogo Peppered Moths model. http://ccl.northwestern.edu/netlogo/models/PepperedMoths. Center for Connected Learning and Computer-Based Modeling, Northwestern University, Evanston, IL.** Edited by Alan Sun, Shodor Foundation 2003 **@#$#@#$#@defaulttrue0Polygon -7566196 true true 150 5 40 250 150 205 260 250eggtrue0Circle -16745473 true false 47 48 207egg0true0Circle -16711936 true false 45 46 210egg1true0Rectangle -65536 true false 150 151 150 154Circle -65536 true false 61 61 179egg2true0Rectangle -256 true false 150 150 150 152Circle -256 true false 45 45 209moth-darkfalse14Rectangle -1 true false 46 48 104 88Rectangle -1 true false 197 48 253 88Rectangle -16777216 false true 19 9 35 27Rectangle -16777216 true true 1 3 1 4Rectangle -16777216 true true 105 2 195 407Rectangle -16777216 true true 197 92 433 424Rectangle -16777216 true true 187 96 229 391Rectangle -16777216 true true 197 -39 478 47Rectangle -16777216 true true 118 -13 202 47Rectangle -16777216 true true 254 47 356 209Rectangle -16777216 true true 184 90 255 92Rectangle -16777216 true true 184 90 212 108Rectangle -16777216 true true -75 -14 105 48Rectangle -16777216 true true -31 49 45 348Rectangle -16777216 true true 45 91 132 308Rectangle -16777216 true true 9 28 36 78Rectangle -1 true false 47 49 101 86Rectangle -1 true false 207 59 230 74Rectangle -7566196 true false 46 49 103 87Rectangle -7566196 true false 198 49 252 87Rectangle -16777216 true true 277 86 504 424Rectangle -16777216 true true 270 -175 349 146Rectangle -16777216 true true 141 -80 550 36Rectangle -16777216 true true -177 -77 147 29Rectangle -16777216 true true -90 12 18 414Rectangle -16777216 true true 111 255 551 374Rectangle -16777216 true true -185 237 175 306Rectangle -16777216 true true 31 88 123 103Rectangle -16777216 true true 179 88 289 114Rectangle -16777216 true true 185 20 196 101Rectangle -16777216 true true 164 23 280 46Rectangle -16777216 true true 159 9 285 47Rectangle -16777216 true true 151 7 285 47Rectangle -1 true false 198 49 251 86Rectangle -1 true false 196 46 253 89Rectangle -1 true false 45 48 104 88moth-dark2false14Polygon -1 true false 150 61 105 16 76 2 46 2 14 16 0 45 0 89 16 122 30 135 61 151 29 166 1 196 1 239 16 273 46 287 18 275 59 299 105 299 121 286 150 256Polygon -1 true false 150 61 196 16 226 1 254 1 286 16 299 45 299 91 285 121 271 136 240 151 271 167 299 196 299 242 286 271 242 299 196 299 151 258Rectangle -16777216 true true 136 16 165 286Polygon -16777216 true true 136 46 105 16 77 2 45 2 13 16 0 44 0 88 17 125 29 136 60 151 30 165 0 194 1 242 16 275 57 299 108 299 138 269Polygon -16777216 true true 164 49 195 17 225 1 255 1 287 15 299 41 299 93 285 121 270 138 241 151 269 165 299 193 299 245 286 272 243 299 195 299 164 272 164 49Line -1 false 136 46 106 16Line -1 false 106 16 76 1Line -1 false 165 48 196 17Line -1 false 196 17 226 1Line -1 false 226 1 256 1Line -1 false 256 1 287 15Line -1 false 287 15 300 45Line -1 false 76 2 45 2Line -1 false 45 2 15 14Line -1 false 15 14 1 43Line -1 false 1 43 1 89Line -1 false 1 89 14 119Line -1 false 14 119 30 137Line -1 false 31 138 60 151Line -1 false 299 44 299 93Line -1 false 299 93 285 119Line -1 false 285 119 272 136Line -1 false 272 136 242 150Line -1 false 61 153 30 165Line -1 false 30 165 2 193Line -1 false 2 195 2 242Line -1 false 2 243 16 273Line -1 false 16 273 58 297Line -1 false 241 152 270 165Line -1 false 270 165 299 195Line -1 false 299 195 298 250Line -1 false 298 250 285 271Line -1 false 285 271 244 298Line -1 false 244 298 193 297Line -1 false 193 297 163 270Line -1 false 135 269 104 298Line -1 false 104 298 58 298Rectangle -7566196 true false 136 17 164 287moth-lightfalse15Rectangle -16777216 true false 46 47 104 89Rectangle -16777216 true false 197 47 253 88Rectangle -1 true true 106 1 194 402Rectangle -1 true true 194 92 544 424Rectangle -1 true true 191 90 464 360Rectangle -1 true true 256 1 370 184Rectangle -1 true true 159 2 268 44Rectangle -1 true true 168 -48 301 31Rectangle -1 true true 29 -29 197 25Rectangle -1 true true -88 -33 106 46Rectangle -1 true true -52 46 46 424Rectangle -1 true true -69 90 108 363Rectangle -1 true true 144 31 256 46Rectangle -1 true true 254 38 261 117Rectangle -1 true true 184 33 195 103Rectangle -1 true true 186 89 271 92Rectangle -16777216 true false 47 47 104 89Rectangle -16777216 true false 45 45 105 89Rectangle -16777216 true false 195 47 253 88Rectangle -16777216 true false 196 59 253 88Rectangle -16777216 true false 196 56 253 89Rectangle -16777216 true false 81 45 105 71moth-light2false15Polygon -1 true true 150 61 105 16 76 2 46 2 14 16 0 45 0 89 16 122 30 135 61 151 29 166 1 196 1 239 16 273 46 287 18 275 59 299 105 299 121 286 150 256Polygon -1 true true 150 61 196 16 226 1 254 1 286 16 299 45 299 91 285 121 271 136 240 151 271 167 299 196 299 242 286 271 242 299 196 299 151 258Line -16777216 false 150 60 105 16Line -16777216 false 105 16 78 1Line -16777216 false 78 1 45 1Line -16777216 false 45 1 15 14Line -16777216 false 15 14 0 43Line -16777216 false 0 43 0 86Line -16777216 false 0 86 16 123Line -16777216 false 16 123 30 134Line -16777216 false 30 134 60 151Line -16777216 false 60 151 30 165Line -16777216 false 30 165 0 194Line -16777216 false 0 194 1 240Line -16777216 false 1 240 15 272Line -16777216 false 15 272 57 299Line -16777216 false 57 299 105 298Line -16777216 false 105 298 149 257Line -16777216 false 149 257 196 298Line -16777216 false 196 298 242 298Line -16777216 false 242 298 285 271Line -16777216 false 285 271 299 242Line -16777216 false 299 242 299 194Line -16777216 false 299 194 271 167Line -16777216 false 271 167 242 152Line -16777216 false 242 152 270 137Line -16777216 false 270 137 285 121Line -16777216 false 285 121 299 91Line -16777216 false 299 91 299 44Line -16777216 false 299 44 285 15Line -16777216 false 285 15 253 0Line -16777216 false 253 0 225 0Line -16777216 false 225 0 195 16Line -16777216 false 195 16 149 62Rectangle -7566196 true false 135 16 164 286@#$#@#$#@NetLogo 1.3@#$#@#$#@@#$#@#$#@@#$#@#$#@
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -