globals [colList numCols maxPos constants speciesNum envList language speciesList baseColor freqList primes dieList numSpecies histList mostCommonSpecies mostCommonGene numMostCommon mostCommonSet mostCommonPosSet numPos mostCommonPosSetWD pop avNumRand avRiskiness mostCommonRiskiness numRandMostCommon numTicks sumPop sumPopSq sumAvNumRand sumAvNumRandSq sumAvRiskiness sumAvRiskinessSq sumNumSpecies sumNumSpeciesSq sumSpeciesNum sumSpeciesNumSq sumNumMostCommon sumNumMostCommonSq sumMostCommonRiskiness sumMostCommonRiskinessSq sumNumPosMostCommon sumNumPosMostCommonSq sumNumRandMostCommon sumNumRandMostCommonSq avPop sdPop avAvNumRand sdAvNumRand avAvRiskiness sdAvRiskiness avNumSpecies sdNumSpecies avSpeciesNum sdSpeciesNum avNumMostCommon sdNumMostCommon avMostCommonRiskiness sdMostCommonRiskiness avNumPosMostCommon sdNumPosMostCommon avNumRandMostCommon sdNumRandMostCommon] turtles-own [xgene energy species numRand] patches-own [penergy num-inds-here prob] to setup clear-all set-default-shape turtles "circle" ;; set colList [red green orange sky brown magenta blue yellow violet lime pink turquoise cyan] set colList remove grey remove black base-colors set colList shuffle append append colList (map [? + 3] colList) (map [? - 3] colList) set numCols length colList set baseColor 9.9 set maxPos (1 + max-pxcor) * (1 + max-pycor) - 1 set speciesNum 0 ;; [["*" 2] ["/" 2] ["+" 2] ["-" 2] ["env" 1] ["rand" 1] ["binRand" 0] ["iflz" 3]] set language [["*" 2] ["/" 2] ["+" 2] ["-" 2] ["binRand" 0] ["iflz" 3]] set constants [0 1 2 3 4 5 6 7 8 9 10 20 30 40 50 100] set primes [2 3 5 7 11 13 17 19 23 29 31 37 41 43 47] set speciesList [] set mostCommonGene [] set mostCommonPosSet [] ask patches [calcProb] generate-new-agents init-pop end ;; generate initnal random agents to generate-new-agents [num] create-turtles init-pop [agent-init] end to agent-init set color white - 1 show-turtle set xgene genExp initial-depth set numRand sum map [ifelse-value (? = "binRand") [1] [0]] nodes-in xgene set energy initial-energy set species nextSpecies -1 if not empty? colList [ set color first colList set colList but-first colList] end to calcProb if pxcor = 0 [set prob 1 stop] if pxcor = 1 [set prob 0 stop] set prob 0 let fact-lis factors-of pxcor foreach fact-lis [ set prob prob + ((1 / (? - 1)) - (1 / ?)) ] end ;;;;;;;;;;;;;;;;; ;;; Main loop and ind actions ;;;;;;;;;;;;;;;;; to go if ticks > maxTime [ stop ] if count turtles = 0 [ stop ] set envList n-values numEnvInputs [random max-pxcor] set dieList [] ask turtles [move] ask patches [set pcolor black] ifelse random-float 1 < disaster-prob [cull] [distribute-food] ask turtles [do] ;; check for species that have gone extinct and put their colour back on colList for future use foreach dieList [ if (count turtles with [species = (first ?)]) = 0 and (not member? second ? colList) [set colList fput second ? colList] ] if count turtles = 0 [stop] ;; graphs and stats do-pop-graph do-rand-graph do-riskiness-graph if lineagesOn? [ do-lineage-plot do-species-hist] do-gen-stats do-num-species if ticks = statStart [init-coll-stats] if ticks > statStart [do-coll-stats] if ticks = maxTime [do-final-stats] tick end to move set xcor (ceiling evalExp xgene) mod (max-pxcor + 1) end to do set energy energy - life-tax if energy < 0 [ if not member? list species color dieList [set dieList fput (list species color) dieList] die] if energy >= reproduce-level [reproduce] end to distribute-food ask patches [ set penergy 0 set pcolor black] let pos-list randPosList let energy-each food / length pos-list foreach pos-list [ ask patch ? 0 [ set penergy energy-each ;; set pcolor green - 2 ]] ask patches [distribute] end to distribute let inds-here turtles-here set num-inds-here count inds-here if num-inds-here = 0 [stop] let energy-each penergy / num-inds-here ask inds-here [set energy energy + energy-each] end to cull let pos-list randPosList foreach pos-list [ ask patch ? 0 [ ask turtles-here [ ;; set pcolor red - 2 if not member? list species color dieList [set dieList fput (list species color) dieList] die] ]] end to reproduce hatch 1 [hatch-init] set energy energy - initial-energy - birth-cost end to hatch-init show-turtle set energy initial-energy if random-float 1 < mut-prob [ let randGene genExp initial-depth set xgene (replaceAtPos (one-of allPos xgene) xgene (atPos (one-of allPos randGene) randGene)) set numRand sum map [ifelse-value (? = "binRand") [1] [0]] nodes-in xgene set species nextSpecies species if not empty? colList [ set color first colList set colList but-first colList] ] end ;;;;;;;;;;;;;;;;;;;;;;; ;; output & stats ;;;;;;;;;;;;;;;;;;;;;; to do-gen-stats set pop count turtles set avNumRand mean [numRand] of turtles set avRiskiness mean [[prob] of patch-here] of turtles set colList remove-duplicates colList set numSpecies 1 + length remove-duplicates [species] of turtles set mostCommonSpecies one-of modes [species] of turtles set mostCommonSet turtles with [species = mostCommonSpecies] set numMostCommon count mostCommonSet set mostCommonPosSet [xcor] of mostCommonSet set mostCommonPosSetWD sort remove-duplicates mostCommonPosSet set mostCommonRiskiness mean [[prob] of patch-here] of mostCommonSet set numPos length remove-duplicates mostCommonPosSet set mostCommonGene [xgene] of one-of mostCommonSet set numRandMostCommon [numRand] of one-of mostCommonSet end to init-coll-stats set numTicks 0 set sumPop 0 set sumPopSq 0 set sumAvNumRand 0 set sumAvNumRandSq 0 set sumAvRiskiness 0 set sumAvRiskinessSq 0 set sumNumSpecies 0 set sumNumSpeciesSq 0 set sumSpeciesNum 0 set sumSpeciesNumSq 0 set sumNumMostCommon 0 set sumNumMostCommonSq 0 set sumMostCommonRiskiness 0 set sumMostCommonRiskinessSq 0 set sumNumPosMostCommon 0 set sumNumPosMostCommonSq 0 set sumNumRandMostCommon 0 set sumNumRandMostCommonSq 0 end to do-coll-stats set numTicks numTicks + 1 set sumPop sumPop + pop set sumPopSq sumPopSq + pop ^ 2 set sumAvNumRand sumAvNumRand + avNumRand set sumAvNumRandSq sumAvNumRandSq + avNumRand ^ 2 set sumAvRiskiness sumAvRiskiness + avRiskiness set sumAvRiskinessSq sumAvRiskinessSq + avRiskiness ^ 2 set sumNumSpecies sumNumSpecies + numSpecies set sumNumSpeciesSq sumNumSpeciesSq + numSpecies ^ 2 set sumSpeciesNum sumSpeciesNum + speciesNum set sumSpeciesNumSq sumSpeciesNumSq + speciesNum ^ 2 set sumNumMostCommon sumNumMostCommon + numMostCommon set sumNumMostCommonSq sumNumMostCommonSq + numMostCommon ^ 2 set sumMostCommonRiskiness sumMostCommonRiskiness + mostCommonRiskiness set sumMostCommonRiskinessSq sumMostCommonRiskinessSq + mostCommonRiskiness ^ 2 set sumNumPosMostCommon sumNumPosMostCommon + numPos set sumNumPosMostCommonSq sumNumPosMostCommonSq + numPos ^ 2 set sumNumRandMostCommon sumNumRandMostCommon + numRandMostCommon set sumNumRandMostCommonSq sumNumRandMostCommonSq + numRandMostCommon ^ 2 end to do-final-stats set avPop sumPop / numTicks set sdPop sqrt max list 0 (sumPopSq / numTicks - (sumPop / numTicks) ^ 2) set avAvNumRand sumAvNumRand / numTicks set sdAvNumRand sqrt max list 0 (sumAvNumRandSq / numTicks - (sumAvNumRand / numTicks) ^ 2) set avAvRiskiness sumAvRiskiness / numTicks set sdAvRiskiness sqrt max list 0 (sumAvRiskinessSq / numTicks - (sumAvRiskiness / numTicks) ^ 2) set avNumSpecies sumNumSpecies / numTicks set sdNumSpecies sqrt max list 0 (sumNumSpeciesSq / numTicks - (sumNumSpecies / numTicks) ^ 2) set avSpeciesNum sumSpeciesNum / numTicks set sdSpeciesNum sqrt max list 0 (sumSpeciesNumSq / numTicks - (sumSpeciesNum / numTicks) ^ 2) set avNumMostCommon sumNumMostCommon / numTicks set sdNumMostCommon sqrt max list 0 (sumNumMostCommonSq / numTicks - (sumNumMostCommon / numTicks) ^ 2) set avMostCommonRiskiness sumMostCommonRiskiness / numTicks set sdMostCommonRiskiness sqrt max list 0 (sumMostCommonRiskinessSq / numTicks - (sumMostCommonRiskiness / numTicks) ^ 2) set avNumPosMostCommon sumNumPosMostCommon / numTicks set sdNumPosMostCommon sqrt max list 0 (sumNumPosMostCommonSq / numTicks - (sumNumPosMostCommon / numTicks) ^ 2) set avNumRandMostCommon sumNumRandMostCommon / numTicks set sdNumRandMostCommon sqrt max list 0 (sumNumRandMostCommonSq / numTicks - (sumNumRandMostCommon / numTicks) ^ 2) ;; set avXXX sumXXX / numTicks set sdXXX sqrt max list 0 (sumXXXSq / numTicks - (sumXXX / numTicks) ^ 2) end to do-pop-graph set-current-plot "pop" plot count turtles end to do-rand-graph set-current-plot "Average Number of Rand" if count turtles > 0 [plot mean [numRand] of turtles] end to do-num-species set-current-plot "num species" plot numSpecies end to do-riskiness-graph set-current-plot "av riskiness" if count turtles > 0 [plot mean [[prob] of patch-here] of turtles] end to do-lineage-plot if not empty? speciesList [ set-current-plot "Lineages" set-plot-x-range 0 ( ticks + 1) set freqList (freqOfIn ([species] of turtles) speciesList) let maxNum length freqList set-plot-y-range 0 (maxNum + 1) let pos 0 let am 0 repeat maxNum [ set am item (maxNum - pos - 1) freqList set-plot-pen-color baseColor - min list am 9 plot-pen-up plotxy (ticks) pos plot-pen-down plotxy (ticks + 1) pos set pos pos + 1 ] ] end to do-species-hist set-current-plot "species num" clear-plot set histList reverse sort filter [? > 0] freqList set-plot-x-range 0 49 let xc 0 foreach histList [ plotxy xc first histList set histList but-first histList set xc xc + 1 ] end to addSpeciesAfter [sp oldSp] if not (member? sp speciesList) [ ifelse member? oldSp speciesList [let oldPos position oldSp speciesList set speciesList insertAfter sp oldPos speciesList] [show oldSp XXX set speciesList lput sp speciesList] ] end to addSpecies [sp] if not (member? sp speciesList) [ set speciesList fput sp speciesList ] end to addSpeciesList [spList] foreach spList [addSpecies ?] end ;;;;;;;;;;;;;;;;;;;;;;; ;; specific utils ;;;;;;;;;;;;;;;;;;;;;; to-report randPosList let seed randInt report n-values (1 + floor (max-pxcor / seed)) [? * seed] end to-report randInt let num 1 + floor (1 / (1 - random-float 1)) ifelse num <= maxPos [report num] [report randInt] end to-report genExp [depth] if depth = 0 [report n-of 1 constants] let choicePair one-of language let keywrd first choicePair let nary second choicePair if keywrd = "binRand" [report (list "binRand")] if keywrd = "env" [report (list "env" (list random numEnvInputs))] let branch1 genExp (depth - 1) if nary = 1 [report (list keywrd branch1)] let branch2 genExp (depth - 1) if nary = 2 [report (list keywrd branch1 branch2)] let branch3 genExp (depth - 1) if nary = 3 [report (list keywrd branch1 branch2 branch3)] XXX end to-report evalExp [expression] let keyterm first expression let rest but-first expression ;; nullary if is-number? keyterm [report keyterm] if keyterm = "binRand" [report random 2] ;; env ;; unary let firstarg evalExp first rest if keyterm = "env" [report item ((ceiling firstarg) mod numEnvInputs) envList] if keyterm = "rand" [report random ceiling firstarg] ;; binary let secondarg evalExp second rest if keyterm = "*" [report firstarg * secondarg] if keyterm = "/" [ifelse secondarg = 0 [report 0] [report firstarg / secondarg]] if keyterm = "+" [report firstarg + secondarg] if keyterm = "-" [report firstarg - secondarg] ;; terneray let thirdarg evalExp third rest if keyterm = "iflz" [ifelse (firstarg < 0) [report secondarg] [report thirdarg]] end to-report nextSpecies [parent] if lineagesOn? [ ifelse parent < 0 [addSpecies speciesNum] [addSpeciesAfter speciesNum parent]] set speciesNum speciesNum + 1 report speciesNum - 1 end ;;;;;;;;;;;;;;;;;;;;;;; ;; general utils ;;;;;;;;;;;;;;;;;;;;;; to-report insert [itm pos lis] report (sentence sublist lis 0 pos (list itm) sublist lis pos (length lis)) end to-report insertAfter [itm pos lis] report insert itm (pos + 1) lis end to-report safeSubList [lis srt en] let len length lis if en < 1 or srt > len [report []] report subList lis max list 0 srt min list en len end to-report nodes-in [lis] if not is-list? lis [report (list lis)] let op-list [] foreach lis [set op-list append op-list nodes-in ?] report op-list end to-report second [lis] report item 1 lis end to-report third [lis] report item 2 lis end to XXX let tt 1 set tt tt - 1 set tt 1 / tt end to-report showPass [arg] show arg report arg end to-report posBiggest [lis] report position (reduce [ifelse-value (?1 >= ?2) [?1] [?2]] lis) lis end to-report allPos [expr] let oplis [[]] foreach but-first (n-values (length expr) [?]) [ let pos ? let posLis allPos (item pos expr) set opLis append (map [fput pos ?1] posLis) opLis ] report opLis end to-report replaceAtPos [posList baseExpr insExpr] if posList = [] [report insExpr] report replace-item (first posList) baseExpr (replaceAtPos (but-first posList) (item first posList baseExpr) insExpr) end to-report atPos [posList expr] if empty? posList [report expr] report atPos but-first posList item (first poslist) expr end to-report append [list1 list2] if empty? list1 [report list2] report fput (first list1) (append (but-first list1) list2) end to-report chooseProbilistically [numList] report findPos (random-float 1) cummulateList scaleList numList end to-report chooseReverseProbilistically [numList] if length numList = 1 [report 0] report findPos (random-float 1) cummulateList reverseProbList scaleList numList end to-report reverseProbList [numList] report map [1 - ?1] numList end to-report cummulateList [numList] report cummulateListR numList 0 end to-report cummulateListR [numList cumm] if empty? numList [report []] let newCumm cumm + first numList report fput newCumm cummulateListR but-first numList newCumm end to-report scaleList [numList] let sumList sum numList if sumList = 0 [report numList] report map [?1 / sumList] numList end to-report findPos [vl numList] report findPosR vl numList 0 end to-report findPosR [vl numList pos] if empty? numList [report pos] if vl <= (first numList) [report pos] report findPosR vl but-first numList (1 + pos) end to-report freqOfIn [lis allList] report reduce [fput (numOfIn ?2 lis) ?1 ] (fput [] allList) end to-report freqOf [lis] if empty? lis [report []] report fput (list (numOfIn first lis lis) (first lis)) (freqOf remove first lis lis) end to-report freqRep [lis] report sort-by [first ?1 > first ?2] filter [first ? > 1] freqOf lis end to-report numOfIn [itm lis] report length (filter [itm = ?] lis) end to-report patchesToDist [dist] if dist = 0 [report patch-here] let patchList [] foreach seq (-1 * dist) dist 1 [ let xc ? foreach seq (-1 * dist) dist 1 [ set patchList fput patch-at xc ? patchList ] ] report patch-set patchList end to-report individualsToDist [dist] report turtles-on patchesToDist dist end to-report hammingDist [gene1 gene2] report sum (map [ifelse-value (?1 = ?2) [0] [1]] gene1 gene2) end to-report distBetween [x1 y1 x2 y2] report (max list abs (x1 - x2) abs (y1 - y2)) ;; report sqrt (((x1 - x2) ^ 2) + ((y1 - y2) ^ 2)) end to-report seq [from upto stp] report n-values (floor ((upto - from + 1) / stp)) [from + ? * stp] end to-report safeDiv [numer denom] if denom = 0 [report 0] report numer / denom end to-report flip-bit [pos bitList] report replace-item pos bitList (1 - (item pos bitList)) end to-report cross [g1 g2] let ps random (1 + length g1) report append (safeSubList g1 0 ps) (safeSubList g2 ps length g2) end to showList [lis] foreach but-last lis [type ? type " "] print last lis end to-report factors-of [num] if num < 3 [report (list num)] foreach primes [ if is-divisor-of num ? [report fput ? factors-of (num / ?)] if (? ^ 2) > num [report (list num)] ] end to-report is-divisor-of [num den] report (0 = (num mod den)) end @#$#@#$#@ GRAPHICS-WINDOW 7 10 1217 47 -1 0 6.0 1 10 1 1 1 0 1 1 1 0 199 0 0 0 0 1 ticks CC-WINDOW 5 792 1227 887 Command Center 0 BUTTON 1100 55 1155 88 Go go T 1 T OBSERVER NIL NIL NIL NIL BUTTON 1042 55 1097 88 Reset setup NIL 1 T OBSERVER NIL NIL NIL NIL BUTTON 1160 55 1215 88 Step go NIL 1 T OBSERVER NIL NIL NIL NIL SLIDER 1043 92 1215 125 init-pop init-pop 0 1000 80 1 1 NIL HORIZONTAL SLIDER 1046 556 1218 589 maxTime maxTime 10 10000 10000 10 1 NIL HORIZONTAL SLIDER 1043 130 1215 163 initial-energy initial-energy 0 10 5 .25 1 NIL HORIZONTAL SLIDER 1041 284 1213 317 life-tax life-tax 0 2 0.5 0.1 1 NIL HORIZONTAL SLIDER 1042 324 1214 357 reproduce-level reproduce-level 0 20 12 .5 1 NIL HORIZONTAL SLIDER 1044 400 1216 433 mut-prob mut-prob 0 1 0.1 .01 1 NIL HORIZONTAL SLIDER 1043 171 1215 204 initial-depth initial-depth 0 5 3 1 1 NIL HORIZONTAL SLIDER 1042 248 1214 281 food food 0 1000 1000 1 1 NIL HORIZONTAL SLIDER 1044 438 1216 471 disaster-prob disaster-prob 0 .2 0.2 .001 1 NIL HORIZONTAL SLIDER 1043 210 1215 243 numEnvInputs numEnvInputs 0 10 1 1 1 NIL HORIZONTAL SLIDER 1042 363 1214 396 birth-cost birth-cost 0 100 4 1 1 NIL HORIZONTAL PLOT 7 54 624 306 pop time num 0.0 10.0 0.0 10.0 true false PENS "default" 1.0 0 -16777216 true PLOT 6 313 626 732 Lineages time Species 0.0 10.0 0.0 10.0 true false PENS "default" 1.0 0 -16777216 true SWITCH 1047 517 1157 550 lineagesOn? lineagesOn? 1 1 -1000 PLOT 632 55 1030 214 Average Number of Rand time Num per gene 0.0 10.0 0.0 2.0 true false PENS "default" 1.0 0 -2674135 true PLOT 632 218 1031 390 av riskiness time av prob 0.0 10.0 0.0 1.0 true false PENS "default" 1.0 0 -10899396 true MONITOR 1137 691 1212 732 num species numSpecies 17 1 10 PLOT 633 567 1029 730 species num NIL NIL 0.0 30.0 0.0 40.0 false false PENS "default" 1.0 1 -13345367 true PLOT 633 395 1028 560 num species NIL NIL 0.0 10.0 0.0 10.0 true false PENS "default" 1.0 0 -8630108 true MONITOR 122 736 757 777 gene of most common species mostCommonGene 17 1 10 MONITOR 6 736 120 777 Number most common numMostCommon 17 1 10 MONITOR 844 737 1088 778 Postions sort remove-duplicates mostCommonPosSet 17 1 10 MONITOR 1051 645 1127 686 Population count turtles 17 1 10 MONITOR 1136 646 1212 687 Av Num Rand mean [numRand] of turtles 2 1 10 MONITOR 1051 690 1126 731 Av Riskiness mean [[prob] of patch-here] of turtles 2 1 10 SLIDER 1046 592 1218 625 statStart statStart 0 10000 9000 100 1 NIL HORIZONTAL MONITOR 1091 737 1150 778 Num Pos numPos 17 1 10 MONITOR 1153 737 1211 778 Riskiness mostCommonRiskiness 2 1 10 MONITOR 761 736 841 777 Num Rand numRandMostCommon 17 1 10 @#$#@#$#@ WHAT IS IT? ----------- This is an abstract model to explore the different evolutionary trajectories that might occur in the presence of severe disasters. The model forces the individuals to compromise between getting food and avoiding the disasters, since these have a tendancy to occur in the same places. The geneone and environment is deliberately sufficiently complex to allow an open-ended evolutionary debvelopment of genes. Species here are those with the same geneone. HOW IT WORKS ------------ The environment is a set of niches, labelled by the non-negative integers: 0, 1, 2, 3, ..., max-pxcor. Any number of individuals exist at these locations. Each individual has an energy level and a gene. When evaluated the gene specifies the niche it occupies. The gene is of the form of an arithmetic expression using: *, +, -, /, iflz, binRand plus a number of common environmental inputs and a set of constants. (env 1, env 2, ... env numEnvInputs) are the environmental inputs, representing some common but varying input from the environment - these are randomly determined as a random integer drawn from {0, 1, ... max-pxcor} at the start of each tick. "iflz" (if less than zero) takes 2 arguments - it evaluates the first and if the result is less than 0 if returns the result of evaluating the second argument else the result of evaluating the third. binRand randomly returns 0 or 1 independently each time its called. The constants are {0 1 2 3 4 5 6 7 8 9 10 20 30 40 50 100}. Every time period: an integer, i, is chosen, indicating the set I={0, i, 2i, 3i, ...}. With a probability of "disaster-prob" all individuals at any of these locations are killed - otherwise "food" about of energy is distributed to the locations in I, which are, in turn, divided up between those individuals at those locations; energy of value "life-tax" is subtracted from all; those with energy < 0 die; those with energy >= reproduce-level reproduce once - creating a new turtle with the same gene as them (but mutated with a probabiliby of "mut-prob") and initial energy of "initial-energy"; "initial-energy"+"birth-cost" is subtracted from the parent. THE OUTPUT ------------- The top line shows the niches and (the topmost which is arbitrary) individual there with a different colour for each species (whilst discernable colours are enough, thereafter white for any additional species). Graphs are shown that display: the population level over time; the current number of species alive; the average number of occurences of the "bindRand" primitive in the genes over all individuals; the average "riskiness" of individuals - measured by the probability of their location being selected in the set I each time; and a chart showing the number of individuals in the most populous species (ranked in order of size). There is also a display indicating the genetic lineages as they develop over time, with a darker line for more populous lines and a "branch" each time a new species is created by mutation - its show starting just above the parent species from the time it starts existing. Due to the computation required to calculate the lineages and hence the numbers of each species, this is switchable using the "lineagesOn?" switch. This switch does not affect the model in any way other than the ways the output is displayed. Statistics collected from "statStart" to the end include: avPop sdPop avAvNumRand sdAvNumRand avAvRiskiness sdAvRiskiness avNumSpecies sdNumSpecies avSpeciesNum sdSpeciesNum avNumMostCommon sdNumMostCommon avMostCommonRiskiness sdMostCommonRiskiness avNumPosMostCommon sdNumPosMostCommon avNumRandMostCommon sdNumRandMostCommon ticks @#$#@#$#@ 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 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 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 4.0.4 @#$#@#$#@ @#$#@#$#@ @#$#@#$#@ setup go avPop sdPop avAvNumRand sdAvNumRand avAvRiskiness sdAvRiskiness avNumSpecies sdNumSpecies avSpeciesNum sdSpeciesNum avNumMostCommon sdNumMostCommon avMostCommonRiskiness sdMostCommonRiskiness avNumPosMostCommon sdNumPosMostCommon avNumRandMostCommon sdNumRandMostCommon ticks setup go avPop sdPop avAvNumRand sdAvNumRand avAvRiskiness sdAvRiskiness avNumSpecies sdNumSpecies avSpeciesNum sdSpeciesNum avNumMostCommon sdNumMostCommon avMostCommonRiskiness sdMostCommonRiskiness avNumPosMostCommon sdNumPosMostCommon avNumRandMostCommon sdNumRandMostCommon ticks @#$#@#$#@ @#$#@#$#@ default 0.0 -0.2 0 0.0 1.0 0.0 1 1.0 0.0 0.2 0 0.0 1.0 link direction true 0 Line -7500403 true 150 150 90 180 Line -7500403 true 150 150 210 180 @#$#@#$#@