breeds [ ;; turtles in the 3 sub-models: wanderers ;; turtles in Equidistant-Point that walk out from green patches registrars ;; turtles in Equidistnat-Point that live on a patch and keep and show its statistical data peri-walkers ;; turtles in Circumference: They walk along arcs running through their patches retired ;; turtles in Circumference change their breed after they have finished their job darts ;; turtles in Epicenter: They all emerge from the middle ] globals [ vertices ;; number of selected squares (patches) from which wanderers emerge attempts ;; number of times the wanderers have attempted to convene on the same patch attempts-list ;; list of how many attempts it took per convention successes-per-this-sample ;; how many successes occurred in the current sample of attempts successes-per-sample-list ;; list of how many successes occurred in all samples up to the current moment probab ;; calculates the probability of a success based on the number of attempts since the previous probab-list ;; list of probabilities per each success probability-per-sample-list ;; list of probabilities per each sample successful-attempt? ;; Boolean variable that is true if an attempt was successful step ;; How far peri-walkers walk in Circumference count-have-stepped ;; Tracks how many times darts have stepped forward in Epicenter ] patches-own [ counter ;; in Epicenter, this variable keeps track of how many times darts have visited the patch pmy-color ;; "reminds" patches of their color before it is temporarily changed ] ;; In Equidistant-Point, tracks frequency of wanderers convening on that ;; patch out of all their attempts since they stepped there registrars-own [conventions] ;; a "convention" is the event when ALL active wanderers land on the same patch to setup ask turtles [die] ca set attempts-list [] set probab-list [] set successes-per-sample-list [] set probability-per-sample-list [] set successful-attempt? false chequer set step .001 ;; this value can be changed by users end to chequer ;; creates the 9-by-9 "chess-board" appearance of the graphics window with a blue perimeter ask patches [ ;; even patches and odd patches ifelse ( ( pxcor / 2 = int (pxcor / 2) ) and ( pycor / 2 = int (pycor / 2) ) ) or ( ( pxcor / 2 != int (pxcor / 2) ) and ( pycor / 2 != int (pycor / 2) ) ) [set pcolor 3] [set pcolor 7] if abs pxcor = screen-edge-x or abs pycor = screen-edge-y [set pcolor 104] set pmy-color pcolor ] end ;;user uses mouse to paint vertex-patches red to select-vertices if mouse-down? [ ask patch round mouse-xcor round mouse-ycor [ if attempts > 0 [user-message "At this point, you may wish to press SETUP again to initialize variables"] if pcolor = 104 [stop] ifelse pcolor = red [ set pcolor pmy-color ] [ set pcolor red ] ] set vertices count patches with [pcolor = red] stop ] end ;;from every vertex a wanderer emerges and heads off randomly, in synchrony with other wanderers to find-equidistant-point if count patches with [pcolor = red] < 2 [stop] if not keep-greens? [ ask patches with [pcolor = green] [set pcolor pmy-color] if any? registrars [ask registrars [set color pcolor]] ] set attempts attempts + 1 update-sampling-data ask patches with [pcolor = yellow] [ set pcolor pmy-color ] ask patches with [pcolor = red] [ sprout 1 [ set breed wanderers set color magenta set heading random-float 360.0 ] ] while [any? wanderers] [ sprint-straight ] if successful-attempt? [ set successful-attempt? false if single-success? [ stop ] ] ;; registrars are the turtles that live in patches where there has been a wanderers' convention ;; registrars have labels that show the frequency of conventions on their respective patches ;; out of all the attempts that the wanderers have made to convene anywhere. this code updates ;; the registrars' label every attempt. so usually the frequency label values decrease sharply if any? registrars [ask registrars [registrar-update] ] end ;;if there are as many turtles on the same patch as there are vertices then that means that all ;;our wanderers have convened together and this patch is equidistant from all vertices becuase ;;all wanderers have traveled as far over the same time. This patch can be painted green. to sprint-straight if not (count wanderers > 0) [stop] ask wanderers [ fd 1 if pcolor = 104 ;;so as not to waste time, if a single wanderer has stepped out of the chequered area, the attempt stops [ ask wanderers [ die ] ] if leave-trail? ;; there is a user option to have the wanderers leave a yellow trail where they have been per attempt [ if pcolor < 10 [ set pcolor yellow ] ] ] ;; this is the key code in the Equidistant-Point rationale ask patches with [count wanderers-here = vertices] [ success ifelse count registrars-here = 0 [ sprout 1 [ set breed registrars set color green set size .1 registrar-action ;; label yourself with the frequency of this convention out of all attempts ] ] [ ask registrars-here [registrar-action] ] ] if successful-attempt? [ plots-n-pans ;; playful name that indicates a procedure for plotting the statistical data ask wanderers [die] ;; because we need to start a new attempt now ] end to success set successful-attempt? true repeat 5 ;; blink procedure [ set pcolor green set pcolor black ] if keep-greens? [ set pcolor green ;;so we can see all equidistant points, e.g., for 'verticies = 2' there is more than a single such point ask registrars [if pcolor = green [set color green]] ] end to update-sampling-data ;; updates each time a sample has ended running locals [probability-per-this-sample] if (sum attempts-list + attempts) / sample-size-in-#attempts = int ((sum attempts-list + attempts) / sample-size-in-#attempts) ;;if the number of attempts is a multiple of sample size [ ;; finds increment in successes since last sampling point ;; note that the length of a list here is in effect how many times the list ;; was updated, that is, how many times whatever it is listing actually happened set successes-per-this-sample ( length attempts-list - sum successes-per-sample-list ) set successes-per-sample-list ( fput successes-per-this-sample successes-per-sample-list ) set probability-per-this-sample 100 * successes-per-this-sample / sample-size-in-#attempts set probability-per-sample-list ( fput probability-per-this-sample probability-per-sample-list ) set-current-plot "#Successes Per Sample" if not empty? (remove 0 successes-per-sample-list) [set-plot-x-range 0 ( max successes-per-sample-list )] set-current-plot-pen "#Successes Per Sample" histogram-list successes-per-sample-list set-current-plot-pen "mean-successes-per-sample" plot-pen-reset plotxy ( mean successes-per-sample-list ) plot-y-min plotxy ( mean successes-per-sample-list ) plot-y-max set-current-plot "% Successes Per Sample" if not empty? (remove 0 probability-per-sample-list) [set-plot-x-range 0 ( max probability-per-sample-list )] set-current-plot-pen "% Successes Per Sample" histogram-list probability-per-sample-list set-current-plot-pen "mean-prob-per-sample" plot-pen-reset plotxy ( mean probability-per-sample-list ) plot-y-min plotxy ( mean probability-per-sample-list ) plot-y-max ] end to registrar-action ;; turtles procedure ask registrars with [count wanderers-here = vertices] [set conventions conventions + 1] registrar-update end to registrar-update ;; turtle procedure locals [helper] set helper precision (100 * conventions / (sum attempts-list + attempts) ) 2 set label word helper "%" end to plots-n-pans set attempts-list ( fput attempts attempts-list ) plot-attempts update-probab-stuff set attempts 0 end to plot-attempts ;; If no data then there is no point plotting. Also, this debugs the "max attempts-list" that ;; would otherwise get confused if length attempts-list = 0 [stop] set-current-plot "Distribution of Per-Round Attempts until Success" set-current-plot-pen "attempts per round" set-plot-x-range 0 (10 + ceiling max attempts-list ) histogram-list attempts-list set-current-plot-pen "rounds-mean" plot-pen-reset plotxy mean attempts-list plot-y-min plotxy mean attempts-list plot-y-max end to update-probab-stuff if empty? attempts-list [stop] ;; note that probability can be thought of as the reciprocal of frequency set probab (100 * (precision (1 / (first attempts-list)) 5)) set probab-list ( fput probab probab-list ) set-current-plot "Distribution of Per-Success Probabilities" set-plot-x-range 0 ( precision (.1 + max probab-list ) 2 ) set-current-plot-pen "probab-list" histogram-list probab-list set-current-plot-pen "probab-mean" plot-pen-reset plotxy ( mean probab-list ) plot-y-min plotxy ( mean probab-list ) plot-y-max end to-report cumulative-frequency locals [cum-probab] set cum-probab (100 * (length attempts-list / (sum attempts-list + attempts))) set cum-probab precision ((round (10000 * cum-probab)) / 10000) 4 report (cum-probab + " %") end to-report ratio-success report first probab-list + " %" end to-report quickest-success ifelse empty? attempts-list [report "N/A"] [report min attempts-list + " attempt(s)"] end to-report slowest-success ifelse empty? attempts-list [report "N/A"] [report max attempts-list + " attempt(s)"] end to-report lowest-probability ifelse empty? probab-list [report "N/A"] [report word precision min probab-list 3 " %"] end to-report highest-probability ifelse empty? probab-list [report "N/A"] [report word precision max probab-list 3 " %"] end ;;%$%$%%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$ ;;%$%$%%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$ ;;%$%$%%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$ ;;%$%$%%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$ ;;%$%$%%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$ ;;CIRCUMFERENCE: turtle-geometry analytic: peri-walkers-own [ xmy-patch ymy-patch ;; permanent coordiantes temp-X temp-Y ;; temporary coordinates radius ;; integer-unit distance between patch 0 0 and the peri-walker's patch. There may be more than ;; one such radius and the peri-walker takes care of each one separately perimeter ;; 2 * pi * radius. This is the length of the circumference of the circle that is centered on patch 0 0 ;; and passes through the peri-walker's patch. There may be more than one such perimeter arcs-in-this-patch ;; number of arcs (parts of perimeters) that lie in the peri-walker's patch how-far-I've-stepped ;; the peri-walker's "odometer" as it walks along the arc in its patch probaby ;; calculated probability of the imaginary turtle in patch 0 0 (the wanderer from "Equidistant Point") ;; to land on the peri-walker's patch. first-time-round? ;; boolean that keeps track to help determine whether peri-walker should left or right ] to choose-patch ;; for interfacing with user ask patch 0 0 [if pcolor != red [set pcolor red]] if mouse-down? [ if pcolor-of patch-at mouse-xcor mouse-ycor = red [user-message "Sorry, you can't choose this one" choose-patch] set pcolor-of patch-at mouse-xcor mouse-ycor sky ask patches with [pcolor = sky] [ who-am-I ;; sprout a peri-walker ] go ] end to all-patches ;; procedure called by interface button. User has option of activating all the patches at once setup ask patches with [pcolor != red and not (pxcor = 0 and pycor = 0)] [who-am-I] go end to who-am-I ;; patch procedure sprout 1 [ set breed peri-walkers ;; "peri" is short for perimeter set xmy-patch xcor set ymy-patch ycor set color yellow set size .5 set first-time-round? true ] end to go ask peri-walkers [ find-your-arcs ;; establish how many arcs pass through your patch and where determine-your-circles-values ;; establish the radius and calculate the perimeter of these perimeters label-and-retire ;; show the data you have calculated and change your breed (stop working) ] end to find-your-arcs ;; turtle procedure set heading towards-nowrap patch 0 0 ;; brings turtle to position that is integer units from patch 0 0. ;; This point is on the circumference running through the peri-walker's patch, and ;; along which the peri-walker must walk. The way the code has been set, the peri-walker ;; will repeat this procedure in the case that there is more than a single arc in its patch fd (distancexy 0 0 - int distancexy 0 0) repeat 2 ;;because a maximum of two "integer arcs" could pass through a single patch [ if ( ( xmy-patch = pxcor ) and ( ymy-patch = pycor) ) ;;turtle checks to see whether it is still in the same patch [ set temp-X xcor set temp-Y ycor set arcs-in-this-patch arcs-in-this-patch + 1 ] bk 1 ] setxy temp-X temp-Y ;;turtle situates itself on the arc that -- if there are two -- is further away from patch 0 0 end to determine-your-circles-values ;; turtle procedure if arcs-in-this-patch > 0 [ if how-far-I've-stepped > 0 [ setxy temp-X temp-Y set heading towards-nowrap patch 0 0 fd 1 set temp-X xcor set temp-Y ycor ] set radius distance patch 0 0 set perimeter (2 * pi * radius) ifelse first-time-round? [rt 90] [lt 90] walk-along-arc-and-add-up-its-length-discretely sum-up-my-findings-so-far-and-set-off-again ] end to walk-along-arc-and-add-up-its-length-discretely ;; turtle procedure odometer setxy temp-X temp-Y ;setxy xmy-patch ymy-patch ;; returns to home base set heading towards-nowrap patch 0 0 ifelse first-time-round? [rt 90] [lt 90] odometer end to odometer ;; turtle procedure ;; as long as I'm in my original patch from which I sprouted... while [ ( xmy-patch = pxcor ) and ( ymy-patch = pycor ) ] [ fd step set how-far-I've-stepped ( how-far-I've-stepped + step ) ;; re-orient so as to take another step along the perimeter ifelse first-time-round? [lt 360 * step / perimeter] [rt 360 * step / perimeter] ] set first-time-round? not first-time-round? end to sum-up-my-findings-so-far-and-set-off-again ;; turtle procedure ;; 'probaby' keeps track of the chance of a wanderer from patch 0 0 stepping in the peri-walker's patch set probaby probaby + precision (100 * how-far-I've-stepped / perimeter) 2 setxy temp-X temp-Y set heading towards-nowrap patch 0 0 fd 1 set arcs-in-this-patch (arcs-in-this-patch - 1) determine-your-circles-values end to label-and-retire ;; turtle procedure ;; peri-walkers become retired and lable their findings set color sky setxy xmy-patch ymy-patch set label word probaby "%" set pcolor scale-color sky probaby 10 1 set color yellow set size .3 set breed retired end ;;%$%$%%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$ ;;%$%%%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$ ;;%$%$%%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$ ;;%$%$%%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$ ;;%$%$%%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$%$ ;; Epicenter: turtle-geometry probabilistic to epicenter if vertices > 1 [user-message "Oops, I think you should first stop other running models by pressing HALT under here. V"] setup ask patch 0 0 [if pcolor != red [set pcolor red]] repeat num-samples [ set count-have-stepped 0 birth dart ask darts [die] ] ifelse squares? [grade-pcolor-proportion-to-square-bands] [grade-pcolor-proportion-to-all] end to birth create-custom-darts num-turtles [set heading random-float 360.0 set size .5] end to dart ;; darts walk forward according to slider settings ;; the patches keep track of their visits ask darts [ fd step-size ] set count-have-stepped count-have-stepped + 1 ask patches [set counter counter + count turtles-here] ask darts [ if ceiling abs xcor = screen-edge-x or ceiling abs ycor = screen-edge-y [die] ] ifelse count darts = 0 [stop] [if count-have-stepped != steps [dart]] end to grade-pcolor-proportion-to-all ;; colors each patch proportionately to its turtle-visits out of total visits that occurred. locals [helper] set helper sum values-from patches [counter] ask patches [ set pcolor scale-color sky (250 * counter / helper) 10 0 ;;250 is a "magic number" figured out by tinkering sprout 1 [ set color pcolor ifelse On-%-Off-# [ set label word precision (100 * counter / helper) 2 "%" ] [ set label precision counter 0 ] ] ] end to grade-pcolor-proportion-to-square-bands ;; colors each patch proportionately to its turtle-visits out of visits ;; that occurred in patches within the same square band locals [walk1] repeat steps [ set walk1 walk1 + 1 ask patches with [((abs pxcor <= walk1) and (abs pycor = walk1)) or ((abs pxcor = walk1) and (abs pycor <= walk1)) ] [ set pcolor (10 * walk1 + 15) sprout 1 [ set size .1 set color pcolor ifelse On-%-Off-# [ set label word precision (100 * counter / sum values-from patches with [pcolor = 10 * walk1 + 15] [counter]) 2 "%" ] [ set label precision counter 0 ] ] ] ] end ; *** NetLogo Model Copyright Notice *** ; ; This model was created as part of the projects: ; PARTICIPATORY SIMULATIONS: NETWORK-BASED DESIGN FOR SYSTEMS LEARNING IN ; CLASSROOMS and INTEGRATED SIMULATION AND MODELING ENVIRONMENT. ; The project gratefully acknowledges the support of the ; National Science Foundation (REPP & ROLE programs) -- grant numbers ; REC #9814682 and REC-0126227. ; ; Copyright 2003 by Uri Wilensky. Updated 2003. All rights reserved. ; ; Permission to use, modify or redistribute this model is hereby granted, ; provided that both of the following requirements are followed: ; a) this copyright notice is included. ; b) this model will not be redistributed for profit without permission ; from Uri Wilensky. ; Contact Uri Wilensky for appropriate licenses for redistribution for ; profit. ; ; To refer to this model in academic publications, please use: ; Wilensky, U. (2003). NetLogo Equidistant Probability model. ; http://ccl.northwestern.edu/netlogo/models/EquidistantProbability. ; Center for Connected Learning and Computer-Based Modeling, ; Northwestern University, Evanston, IL. ; ; In other publications, please use: ; Copyright 1998 by Uri Wilensky. All rights reserved. See ; http://ccl.northwestern.edu/netlogo/models/EquidistantProbability ; for terms of use. ; ; *** End of NetLogo Model Copyright Notice *** @#$#@#$#@ GRAPHICS-WINDOW 12 12 385 406 5 5 33.0 1 10 1 1 1 CC-WINDOW 643 258 1019 403 Command Center BUTTON 386 74 528 123 Select Vertex select-vertices T 1 T OBSERVER NIL BUTTON 386 125 528 226 Find Equidistant Point find-equidistant-point T 1 T OBSERVER T MONITOR 529 74 648 123 NIL vertices 0 1 BUTTON 386 12 1021 46 Setup setup NIL 1 T OBSERVER T SWITCH 529 159 672 192 leave-trail? leave-trail? 0 1 -1000 MONITOR 2 557 179 606 attempts this round attempts 0 1 PLOT 11 407 398 555 Distribution of Per-Round Attempts until Success Attempts Rounds 0.0 10.0 0.0 4.0 true false PENS "attempts per round" 5.0 1 -16745473 true "rounds-mean" 1.0 1 -16777216 true SWITCH 529 125 672 158 single-success? single-success? 0 1 -1000 MONITOR 487 260 567 309 #successes length attempts-list 3 1 MONITOR 487 310 567 359 #attempts sum attempts-list + attempts 0 1 MONITOR 568 285 639 334 frequency cumulative-frequency 4 1 PLOT 647 407 1019 555 Distribution of Per-Success Probabilities per-success probability (%) freq. 0.0 10.0 0.0 4.0 true false PENS "probab-list" 0.01 1 -65281 true "probab-mean" 1.0 0 -16777216 true SWITCH 529 193 672 226 keep-greens? keep-greens? 0 1 -1000 MONITOR 181 557 398 606 mean #attempts per success mean attempts-list 3 1 MONITOR 181 607 288 656 quickest success quickest-success 3 1 MONITOR 290 607 398 656 slowest success slowest-success 3 1 MONITOR 2 607 115 656 standard deviation standard-deviation attempts-list 1 1 MONITOR 115 607 179 656 variance variance attempts-list 1 1 MONITOR 647 606 761 655 standard deviation standard-deviation probab-list 3 1 MONITOR 762 606 829 655 variance variance probab-list 3 1 MONITOR 647 556 829 605 probability this round word precision (100 / attempts) 3 "%" 4 1 MONITOR 830 556 1019 605 mean probability word precision (mean probab-list) 3 "%" 4 1 MONITOR 830 606 922 655 lowest probab lowest-probability 3 1 MONITOR 924 606 1019 655 highest probab highest-probability 3 1 TEXTBOX 396 301 486 319 cumulative data: BUTTON 675 74 778 124 Choose Patch choose-patch T 1 T OBSERVER NIL BUTTON 677 160 777 226 All Patches all-patches NIL 1 T OBSERVER T BUTTON 792 74 1020 126 Epicenter epicenter NIL 1 T OBSERVER T SLIDER 910 129 1022 162 num-samples num-samples 1 25 1 1 1 NIL TEXTBOX 717 137 807 155 OR TEXTBOX 468 52 969 70 Equidistant-Point Circumference Epicenter SLIDER 387 366 633 399 sample-size-in-#attempts sample-size-in-#attempts 0 10000 1000 50 1 NIL PLOT 400 532 645 656 #Successes Per Sample NIL NIL 0.0 10.0 0.0 4.0 true false PENS "#Successes Per Sample" 0.05 1 -6524078 true "mean-successes-per-sample" 1.0 0 -16777216 true PLOT 400 407 645 530 % Successes Per Sample NIL NIL 0.0 10.0 0.0 4.0 true false PENS "% Successes Per Sample" 0.0010 1 -16711936 true "mean-prob-per-sample" 1.0 0 -16777216 true MONITOR 399 662 482 711 minimum min successes-per-sample-list 3 1 MONITOR 565 662 646 711 maximum max successes-per-sample-list 3 1 MONITOR 483 662 566 711 mean mean successes-per-sample-list 3 1 SLIDER 795 129 908 162 num-turtles num-turtles 1 1000 1000 1 1 NIL SWITCH 795 197 908 230 squares? squares? 0 1 -1000 SWITCH 910 197 1021 230 On-%-Off-# On-%-Off-# 0 1 -1000 SLIDER 795 164 908 197 steps steps 1 4 2 1 1 NIL MONITOR 52 680 135 729 standard dev standard-deviation successes-per-sample-list 3 1 MONITOR 134 680 197 729 variance variance successes-per-sample-list 3 1 MONITOR 196 680 376 729 mean attempts per successes sample-size-in-#attempts / mean successes-per-sample-list 3 1 MONITOR 648 686 718 735 #samples int ((sum attempts-list + attempts) / sample-size-in-#attempts) 3 1 MONITOR 720 686 860 735 successes this sample length attempts-list - sum successes-per-sample-list 3 1 MONITOR 862 686 1012 735 attempts left this sample sample-size-in-#attempts - (attempts + sum attempts-list - length successes-per-sample-list * sample-size-in-#attempts) 0 1 SLIDER 910 164 1021 197 step-size step-size 1 5 1 1 1 NIL TEXTBOX 14 659 379 677 ----------------------------------------------------------------- TEXTBOX 650 657 1013 684 ----------------------------------------------------------------- @#$#@#$#@ WHAT IS IT? (GENERAL) --------------------- This model is a part of the ProbLab curriculum. The ProbLab Curriculum is currently under development at the CCL. For more information about the ProbLab Curriculum please refer to http://ccl.northwestern.edu/curriculum/ProbLab/. This model could also be called "Probability Turtle Geometry." It consists of 3 sub-models, Equidistant Point, Circumference, and Epicenter, that each assists in a different yet complimentary way to making sense of probability in terms of geometry, and making sense of geometry in terms of probability, where both directions employ NetLogo "turtles" (virtual agents). The geometry in the model concerns a polygon, represented by as many vertices as you choose, and the question of locating a point that is equidistant of all the vertices, if such a point exists. From each vertex emerge a turtle that darts forward at a random heading but common speed (1 unit forward per time 'tick'), "hoping" to convene with the other turtles in a single patch, which would thus be equidistant of all vertices. The probability involved concerns the chances of a turtle emerging from a patch at a random heading and at a fixed walking step size to fall on a particular patch. The rationale is that if we understand the geometry then we can hypothesize, test, and confirm the probabilities as well, and vice versa if we understand the probabilities then we can hypothesize, test, and confirm the geometry. This document presents each of the three sub-models separately, and the user is asked to explore the model itself in order to experience the complimentarity of the sub-models. This model is perhaps the most complex of the ProbLab curricular models. If you find it difficult, you may wish to explore "Prob Graph Basics" first, because that model presents the key ideas of this model not in the complex context of geometry and motion but in a more straightforward context of guessing numbers. Important: You may wish to zoom-in the the Interface window by pressing on "smaller" in the Zoom drop-down menu. This is not absolutely necessary but otherwise you will not see several minor monitors at the bottom. ************************ ************************ ** EQUIDISTANT-POINT ** ************************ ************************ WHAT IS IT? ----------- Equidistant-Point is a probabilistic way of thinking about the midpoint in polygons. So it uses geometry inquiry as a context for learning about probability. Whereas there are straightforward geometrical methods for locating a polygon's midpoint, Equidistant Point takes an unusual approach. This approach is perhaps not the most efficient way of going about things, but it is useful in that it helps make sense of probability. Especially, it comtrasts a natural sense of frequency (how many attempts it takes until you succeed to do something) and statistical analysis (how many successes you get per sample). This distinction is enhanced by different typical graph shapes associated with each of the above interpretations. HOW IT WORKS ------------ The user paints some red vertices onto the graphics screen that together outline a shape, e.g., a triangle. Then, the user sets off a search for the midpoint of this shape: From each of the red vertices emerges a pink turtle, called a wanderer, headed in a random direction. Because there are exactly as many wanderers as there are vertices, and because they all emerge simultaneously, if all wanderers arrive at the same spot at the same moment, then that spot is equidistant (equally far away) from all the red vertices. Once again, this because all the wanderers have traveled at the same speed and during the same time. However -- and it is absolutely crucial to emphasize this point early on: In this model a triangle could have more than a single equidistant point, because it is enough that the three wanderers land on the same square ("patch") -- they don't have to land on precisely the same point. This would not work in geometry, where a triangle has only one equidistant point. If the wanderers meet (convene) on a patch then they paint that patch green. If the wanderers miss each other then the moment the first of them reaches the edge of the screen the search is called off immediately (so as not to waste time), and the next attempt begins. The program keeps track of how many attempts it took to find an equidistant point. We call that a single 'round' and an attempt that found an equidistant point is called a 'success.' Some rounds take more attempts than others until there is a success. We are curious to see if there is any logic here: Will we find some kind of pattern over many rounds? For instance, if we repeatedly run the model over the same number of attempts, will we get the same number of successes? How many attempts does it take to get on a success under the conditions we're running the model? How is all this connected to geometry? We can address these question by studying the data as it happens, on monitors and plot windows (although you might want to do some pen-and-paper work to help you think about the geometry. See "Things to try," in "Circumference," below). HOW TO USE IT ------------- To begin using this model, follow the order of the below explanations. Make sure that the 'single-success,' 'leave-trail,' and 'slow-mo' switches are "On." Later, you may wish to change their settings. Following these explanations, we will talk about what you are seeing. buttons: 'Setup' -- initialize variables 'Select Vertices' -- once you press this, you can click on the graphics window to choose (or un-choose) "home bases" for as many turtles as you wish to work with. When you are through selecting, unpress the 'select-vertices' button so as not to make further selections by mistake while the program is running. 'Find Equidistant Point' -- sets off the search procedures. From every red home-base, dart-like turtles (the "wanderers") will pop up headed at a random direction, and will rush straight forward, leaving behind them a yellow trail. Modify this behavior with these switches switches: 'slow-mo' -- when "On" the turtles will move slowly, when "Off" they will move fast. 'single-success' -- when "On", the wandering turtles will stop moving once they have found an equidistant point. When "Off", wanderers will continue to search again and again after each subsequent success, until you unpress 'find-equidistant-point' 'leave-trail' -- when "On" the turtles leave behind them a yellow line per attempt. Explanation of key ideas now follows, to help you make sense of the plots and monitors. Let's clarify some vocabulary we use in this model: "An attempt" is when wanderers emerge from their patches and rush out. An attempt can end either with a "success" (when they all meet together at the same patch) or as a "failure." A "round" is a sequence of attempts that ends with a successs. Rounds can have different lengths, from 1 -- a success on the first attempt -- to millions of attempts (if it's really hard for the wanderers to meet). In fact, you may discover that for some selections of vertices you won't get a success even if you run this model for a whole year! (We leave it up to you, for now, to think why this is the case.) So if we speak of "attempts until success" or "attempts per success", we are talking about how many attempts it took until a success. If we run this model over many attempts and get some successes, we can speak of the average "attempts until success" per round, because some rounds will be longer than others. We can follow this by looking at the plot window "Distribution of Per Round Attempts until Success" and at the monitors around it: 'Distribution of Per-Round Attempts until Success' -- Shows as a histogram the frequency of how many attempts it took for each of the rounds in your experiment. Now, just as one can talk about how many attempts it took until you got a success, you can also talk about frequency of successes. For instance, if it takes on average 100 attempts per 1 success, then the frequency of a success in 1 /100. That is, successes per attempts is the reciprocal of attempts per success. Also, 'successes per attempt' can be thought of as the probability of getting a success on a single attempt. (Actually, that is a very important idea, but we will leave it for you to think about it.) This interpretation is represented in the plot 'Distribution of Per Round Probabilities' and the monitors around it: 'Distribution of Per Round Probabilities' -- Shows as a histogram the frequency of "probabilities" of a success in the rounds in your experiment. Just as we can monitor and plot the probabilities per round, so we can simply count up how many attempts we've had in our experiment as it runs --'#attempts" monitor and how many successes we've had up to this point in the experiment --'#successes' monitor: monitors: '#successes' -- shows how many successes you have had in this experiment. '#attempts' -- shows how many attempts you have had in this experiment. 'frequency' -- the ratio of #successes and #attempts, expressed as a decimal fraction. This can never be larger than 1 because there cannot be more successes than there are attempts. So there is a strong relation between the the 'frequency' monitor that shows the overall probability and the probability-per-round plots and windows on the right. Now we come to the 2 plots in the bottom center and their monitors: A "sample" is a sequence of attempts that are considered a single unit. When a sample ends, a new sample begins and it will have exactly the same number of attempts. Unlike a "round," which always ends with a success, a sample may have no success in it, but it can also have 1, 2, 3, or 77 successes in it. That all depends on the other settings. Say you fix the "sample-size-in-#attempts" slider to 100. Your sample will be a sequence of 100 attempts. By running the model through many samples, we can get an idea of the average number of successes per sample. If on average you get 7 successes per sample of 100 attempts, then you have a 7 / 100 or .7 (or 7%) probability of getting a success on a single event. Does that make sense to you? The #successes-per-sample plot histograms the distribution of successes per samples, e.g,. 9, 2, 3, 0, 4, 4, 8, 2, (mean of 4) When the sample size is 100, it's easy to cacaulate that a mean of 4 means 4 / 100, or 4%. But when you use samples of other sizes, you can look at the... %successes-per-sample monitor, which shows you the calculated average frequency. THINGS TO NOTICE ---------------- Probabilistic geometry is a curious way of thinking, because there is always room for doubt. For instance, if a polygon with 7 vertices does not in fact have a midpoint -- that is, say we could, in principle, prove that geometrically -- we will never know so for certain from a probabilistic perspective...the model will just go on running endlessly and not finding a midpoint, but we'll say, "Maybe if we run it another billion times we'll find that point." See how, for each and every round, as the '#attempts this round' runs up so the 'probability this round' runs down. Mean #attempts-per-success and the cumulative probability are often -- and can be generally taken as -- reciprocal: At every moment of success the former is 'attempts / successes' whereas the other one shows 'successes / attempts.' Though they are basically conveying the same information, both bits of information are useful in different contexts. For instance, the 'mean #attempts per success' is useful for comparing to its neighbor monitor, 'attempts this round.' The 'probability' monitor is another conventional and succinct way of speaking of the expectancy of a phenomenon. The more attempts that go by, the more difficult it becomes to sway the means of attempts-per-round and of the reciprocal probabilities. Why is that? When the program just starts running, the frequency monitor changes fast -- it is not really representitive of the phenomenon. But as time passes this should settle into the the "true" probability of the experiment. Actually, in order to know the "truth," we'd have to wait an infinite number of attempts. We can't wait until infinity, but from the way the probability gradually settles onto a constant level, we infer -- with a grain of salt -- that what you see is what you get. As you run the model, you will see the frequency settling down. How do you think we can decide when the probability has 'settled'? Try to express what it means to 'settle' -- what kind of patterns would you expect? 'Variance' is an index of how clustered the graph is around the average; that is -- what is the graph's 'central tendency'? You will see that as the graph becomes more clustered, the variance decreases. 'Standard deviation' is the square root of variance. It allows us to express how far a sample is from the average in terms of the graph's units. Dure to the logic of this model, there are cases where the model cannot find the middle of a shape. For instance, if you make a 'L' shape of 3 vertices, you would expect the corner to be the "middle" but it is not equidistant from all three vertices. That is, it is 0 units away from the corner. Challenge: Look at the plot "Distribution of per-rounds attempts until success." Notice how the histogram is denser to the left of the mean bar as compared to its right. On the right it gets sparser the further we look (you might have to adjust the value of the x-axis variable in the plot's editing window to see all the right-most bars). If this model ran to infinity, do you think that there would be a more uniform distribution across the graph? What does this mean about human intuition about probabilities? What kind of biases might we form? Are our intuitions informed by whether or not we experience events as independent or as culminations of "attempts until success"? Can you think of an example from your life that relates to this model? But then again... who said that our intuition attends to 'averages?' Perhaps intuition picks up the 'mode' of a distribution and gives it too much weight towards expecting future events? The only complex idea in the 9 monitors on the bottom of the Interface screen is the 'mean attempts per successes'. This monitors refers to the samples. It is an interpretation of the '#successes per sample' plot that that divides the sample size by the mean successes-per-sample. The only reason this monitor is here is to compare its value to that in the 'mean attempts per success' monitor below the 'Distribution of Per Round Attempts until Success' plot. You will see that these values begin as different and then converge. An understanding of why this is so indicates that you have really understood what's going on. THINGS TO TRY ------------- Try to understand the relationship between the different monitors and plots. Why do the graphs have different shapes? Look at the central plots. These show information about samples. Samples are the fixed number of trials that you run repeatedly -- you count how many successes you get in each sample. So some samples yield zero successes. In the current version of the model, these zero-success samples are included in the data set, are processed and are plotted. Do you think it is important to include these zeros? Perhaps zero is just...nothing, so including it is just a waste of resources? You could try to remove the zeros from the data sets and observe the plots. To do that, you would have to study the "remove" primitive in the NetLogo manual and to apply it to the successes-per-sample-list list variable. Using different vertices settings, look at the pattern that emerges in the histograms (the plot windows on the left and on the right). What are their shapes after many successes? Is it all jagged like the Chicago or New York skyline? Are there certain areas that are "taller" than others? Or, perhaps, the pattern is looking like a slide, or maybe like a staircase. What does all this mean? Are these patterns related consistently to the number and/or arrangement of vertices on your screen? Here's general tip, that could be helpful in other models, too: If you want to get to know a model, you should first play around with many variables until you have a sense of the game and of what may be interesting about it, and then focus on a smaller range of variables, changing the values of one at a time. That's how many scientists approach things they are studying. You may choose to edit the plot window so as to adjust it to the experiment you are running. Otherwise you may go beyond its settings, or conversely, you may not be able to detect the shape of the emerging histogram. BTW, if you choose the 'keep' option, then a patch cannot be painted green "again." That is, if the turtles meet on a green patch the program will register the fact, but you will not see a new green patch. NETLOGO FEATURES ---------------- Look in the 'sprint-straight' procedure at the code that detects whether a turtle is on the margin of the graphics window. I have used both 'ceiling' and then 'abs' to modify values of turtles' locations: If a turtle is at -3.7 then next time it walks forwards 1 it will vanish from the screen, or worse, it will wrap around. We don't want that, and so we kindly ask turtles who're about to fall off to, errrr, die. 'Die' means that the turtles vanish from the simulation. Because they no longer exist, they no longer count towards anything at all. For instance, if turtle 5 got the command "die" then there will no longer be a turtle 5 in this run. After you press Setup you may get a new turtle with this number. 'abs' will make that value -3.7 into 3.7 and 'ceiling', in turn, will make 3.7 into 4. If 4 is a screen-edge value (it is now in the default setting of the program, but you can change that) then the turtle will die. EXTENDING THE MODEL ------------------- Are there any other aspects of the activity that you think are worth monitoring and/or plotting? What exactly is a polygon's midpoint, beyond the geometrical definition? If you were to print and cut out the polygon in the graphics window, what, if any, would be the physical meaning of its indicated midpoint? Can you think of a context where you'd really want to know this point? If so, you are welcome to let us know about your experience, and we'll add that context in the above introduction. NetLogo features that you will NOT notice in this model are the "distance" and "towards" primitives. Look them up and see if they would help you with a more straightforward program that finds an equidistant point. Try to figure out why we chose not to use these primitives. How might using them affect the outcomes of the experiment -- the values in the monitors and graphs? This is an example of a more general idea: Just becasue we can use the code to do fancy stuff it doesn't mean we want to use it. Finally, here's an idea for an offshoot model. One way to think about the current model is to draw a circle on a piece of paper and to mark off on its perimeter as many vertices as you wish and then connect these consecutively. The circle's middle is the midpoint because its distances from the vertices are precisely the radii of the circle, which -- of course -- are equal by definition. But then again, what's the use of definitions? Try it yourself. Better more--try to build a model that shows that. Who knows, perhaps you will disprove the fact that a polygon's midpoint is like the center of a circle? ********************** ********************** ** CIRCUMFERENCE ** ********************** ********************** WHAT IS IT? ----------- The 'Circumference' sub-model is similar to the Equidistant-Point sub-model: In both models we explore the chances of turtles to land on a particular patch. But whereas in Equidistant-Point we discover these probabilities "by chance" -- having the turtles roam arround until they all happen to meet on the same patch -- in Circumference we have each turtle calculate it's chances of landing on 1 particular patch. You can think of an invisible turtle on the red patch. Each time, it looks at another patch somewhere on the screen and thinks to itself: "Mmmm, if I walked forwards in a random direction and darted forwards in steps of size 1, I wonder what my chances are of landing on that patch?" So it imagines all the possible places on that patch where it could land. In its imagination, we actually see the turtle walking in that patch along a path(es) of all its possible landing points. The turtle then sums up how far it has walked and using some geometry (see below) the turtle cacluates its probability of landing there. I have used the idea of an imaginary turtle so that you will see how this sub-model is connected to the Equidistant-Point model. However, in the following explanation we will no longer talk about talk about the invisible turtle in the red patch but only about the turtles that walk in other patches. HOW TO USE IT ------------- In this model a turtle is born on the patch you select by pressing CHOOSE-PATCH and clicking on a square in the graphics window. After choosing, press again so it turns off the CHOOSE-PATCH button. You can also select all patches by pressing on ALL-PATCHES: In that case you don't need to touch the graphics window -- just sit back and watch the square-dance ballet. Now, once a turtle is born, it figures out how many integer-circles pass through its patch. By 'integer circles' I mean if you drew circles from the center patch (location 0 0) and if those circles were each of a radii of integer number of patch units (1, 2, 3, etc.) then you would get a set of concentric circles on the screen (with the graphics window set at the current size you would get 4 complete circles and parts of another 2 circles). Some patches will have just one circle pass through them, but perhaps other patches will have a different number of circles pass through them. Its up to you to experiment and find how many circles, if any, pass through each of these patches. Here's the logic of the code. Once the turtle is born, it figures out how many arcs pass through its patch by positioning itself at a variety of plausible integer distances from the red center and asking, each time, "duh...am I still in my original patch?" Next, the turtle sets forth along the tangent of an imaginary arc, which is part of the integer-circle passing through its patch. As it walks, it keeps correcting the path so as to remain on the arc. Also, as it goes along it uses a virtual odometer. I mean, it keeps track of how far it has gone. Also, finally, it keeps asking itself "duh...am I still in the original patch?" If not, it stops, and then either deals with more arcs passing through its patch, if there are any, pass through these patches. Here's the logic of the code. Once the turtle is born, it figures out how many arcs pass through its patch by positioning itself at a variety of plausible integer distances from the red center and asking, each time, "duh...am I still in my original patch?" Next, the turtle sets forth along the tangent of an imaginary arc, which is part of the integer-circle passing through its patch. As it walks, it keeps correcting the path so as to remain on the arc. Also, as it goes along it uses a virtual odometer. I mean, it keeps track of how far it has gone. Also, finally, it keeps asking itself "duh...am I still in the original patch?" If not, it stops, and then either deals with more arcs passing through its patch, if there are any more, or it does the following calculations: Say the turtle figured out that only one arc passes through its patch and that this arc is 3 units away from the middle of the red patch. The length of a circumference of radius R is: | 2 * pi * R So this turtle knows that the length of the circle running through its patch is of length: | 2 * pi * 3 = ~18.85 units The chance of landing on a particular patch is the quotient of that part of the circle that passes through the arc and this circle's perimeter: Let's assume that the turtle walked exactly .5 units along this circle within its patch (I have chosen a simple number -- actually, the numbers are not so simple). So the turtle calculates: | .5 / (2 * pi * 3) = ~.0265 This would mean that the turtle has a .0177 chance of landing in that patch, or 2.66% chance. Here's another way of thinking about this: Remember that the turtle had figured out integer distances from the center? Well, those distances were the radii of its integer-circles. If you know a radius, then you know all kinds of stuff about a circle, such as its perimeter, or circumference. So the turtle knows both the length of the whole circle and the length of the arc from that circle along which it walked. OK, here's the crucial bit of the rationale: The ratio between the arc length and the perimeter is the chance that a turtle coming from the red patch will actually land on this patch. Why? Well, think of it this way: What is the chance that that a turtle emerging from the red patch will land ANYWHERE on the circle? Why, 100% chance, of course. What is the chance that it will fall on the right side of the screen? Why, 50%, of course. What is the chance that it will fall on the bottom right quadrant of the screen? Why, 25%, of course. If you keep on narrowing down to smaller and smaller regions, you'll see that at a certain point it gets difficult to state just where on the screen the turtle will fall, say, about 10% of the time. But notice the following: Half a screen is at 180 / 360 of the possible original orientations. Likewise, quarter of the screen is 90 / 360, and so on. Similarly, the arcs corresponding to these angles are 1/2, 1/4, etc. of the entire circumference. Get it? Play around, perhaps you'll have to resort to paper and pencil (and compass). Basically, all you do is press down either the CHOOSE-PATCH or the ALL-PATCHES and watch what happens. If you're bored with the ballet, switch off the SLOW-MO button. Together with the SETUP button, these are the interface controls you have for this sub-model. THINGS TO TRY ------------- Why is it that some patches have more than a single concentric integer-arc passing through them? Can you predict which arcs are such before you choose a patch? Here's an enormous geometry challenge: A turtle that stands in the middle of a patch and is headed at a random direction, will step in one of its 8 neighboring patches upon taking a single step forward (fd 1). Does it have the same chance of settling on each of the 8 patches? If not, are there different classes of patches, and what is the relative chance of landing in each? Is this related to the patterns we've been discussing? More than just a clue: If you draw a circle of radius r from the center of a patch, then 2/3 of it falls in the four "cross" neighbors (up, down, left, right), and the remaining 1/3 of it is in the 4 "x" neighbors (top left, top right, bottom left, bottom right). This means that, at least as far as that circle is concerned, there is double the chance of falling in one of up/down/left/right squares (1/6 chance each) than in one of the diagonal cells (1/12 chance each). So, getting back to the Equidistant-Point sub-model, if two turtles, Turtle 1 & Turtle 2, have to get to a designated equidistant point, you can multiply Turtle 1's chance of gething there by Turtle 2's chance of getting there. If you had a 3rd turtle, you'd have to multiply all 3 chances. Try this and compare it to what you get when you run the program. Look at the various monitors, too, to evaluate your computation. EXTENDING THE MODEL ------------------- Was it the best decision that turtles should check both arcs that pass through their patch? Isn't that giving them an unfair advantage over their neighbors? That is, isn't it strange that neighboring turtles have different chances? What could be a different logic to go about this? ***************** ***************** ** EPICENTER ** ***************** ***************** WHAT IS IT ---------- Yet another approach to calculating the likelihood of a randomly-headed epicentric turtle moving forward in patch units. At the press of the Epicenter button as many turtles as you have selected (#turtles slider) march out in their respective direction of travel. As the turtles step forward, the patches update the number of times turtles have landed on them. Turtles walk on until either they have gone as many 'steps' as you have prescribed with the 'steps' slider or they hit the screen edge, whence they, sadly, die. But, they will repeat this rigmarole as many times as you have selected with the #samples slider. Eventually, patches that are on square concentric bands (you'll get this once you run it) set their % according to how well they did visitor-wise relative to their band members. But you can choose a different kind of computation and display (see below the "on-%-off-#" and 'squares' switches). HOW TO USE IT ------------- '#turtles' - number of turtles that will emerge from the middle each sample. 'steps' - number of steps each turtle takes per sample. '#samples' - number of times that the group of turtles emerge from the center and marches out. 'squares' (on/off switch) - toggle between two types of computation and display: Either the patches show their statistics relative to their concentric square-band members ("On") or as compared to all patches in the field ("Off"). 'on-%-off-#' - patches can show either of two displays: Either the percentage of the number of turtles they hosted (on) or the raw number of visits. Play with the sliders and switches and see how that affects the eventual statistics labels. Would you expect this picture to be symmetrical along both the x-axis and y-axis?; along diagonal axes? If so, try to figure out which slider variables give you the best approximation of such symmetry. Can you achieve the same level of uniformity with different slider and switch settings? Try to account for what you discover. THINGS TO NOTICE ---------------- Patches in each square-band (the "band-members") are not really equi-distant from their common center. Which are closer, which are further? Do the statistics labels confirm your observation? NETLOGO FEATURE --------------- See how, in the code, turtles (they are called "darts") set their heading random 360.0, and not 360. By adding the ".0" the 'random' reporter gives us "floating" random values, that is they are not necessarily integrals (0, 1, 2, 3, 4, 5, 6, etc.) but also those that are in between (e.g., 0.007366628 or 129.8846623). This is important here because we do not want to under-represent patches that are distant and which may not lie on a ray that is oriented at integer-degrees from the center. Actually, perhaps this doesn't matter here because the graphics window is so small. What do you think? How could you show that? THINGS TO TRY ------------- See if you can compare between findings in this model and those in Circumference. How are they the same? How are they different? How do they relate to Equidistant-Point (the main sub-model in this model)? EXTENDING THE MODEL ------------------- Currently, the model allows you to group pathces in square bands. Perhaps you can come up with code that will allow us to select different groupings of patches. CREDITS AND REFERENCES ---------------------- Thanks to Dor Abrahamson for his work on the design of this model and the ProbLab curriculum. Additional reading: Abrahamson, D. & Wilensky, U. (2003). The quest of the bell curve: A constructionist approach to learning statistics through designing computer-based probability experiments. Proceedings of the Third Conference of the European Society for Research in Mathematics Education, Bellaria, Italy, Feb. 28 - March 3, 2003. Available for download at http://ccl.northwestern.edu/ps/papers/Probability/BellCurve.html To refer to this model in academic publications, please use: Wilensky, U. (2003). NetLogo Equidistant Probability model. http://ccl.northwestern.edu/netlogo/models/EquidistantProbability. Center for Connected Learning and Computer-Based Modeling, Northwestern University, Evanston, IL. In other publications, please use: Copyright 2003 by Uri Wilensky. All rights reserved. See http://ccl.northwestern.edu/netlogo/models/EquidistantProbability for terms of use. @#$#@#$#@ default true 0 Polygon -7566196 true true 150 5 40 250 150 205 260 250 ant true 0 Polygon -7566196 true true 136 61 129 46 144 30 119 45 124 60 114 82 97 37 132 10 93 36 111 84 127 105 172 105 189 84 208 35 171 11 202 35 204 37 186 82 177 60 180 44 159 32 170 44 165 60 Polygon -7566196 true true 150 95 135 103 139 117 125 149 137 180 135 196 150 204 166 195 161 180 174 150 158 116 164 102 Polygon -7566196 true true 149 186 128 197 114 232 134 270 149 282 166 270 185 232 171 195 149 186 149 186 Polygon -7566196 true true 225 66 230 107 159 122 161 127 234 111 236 106 Polygon -7566196 true true 78 58 99 116 139 123 137 128 95 119 Polygon -7566196 true true 48 103 90 147 129 147 130 151 86 151 Polygon -7566196 true true 65 224 92 171 134 160 135 164 95 175 Polygon -7566196 true true 235 222 210 170 163 162 161 166 208 174 Polygon -7566196 true true 249 107 211 147 168 147 168 150 213 150 arrow true 0 Polygon -7566196 true true 150 0 0 150 105 150 105 293 195 293 195 150 300 150 bee true 0 Polygon -256 true false 152 149 77 163 67 195 67 211 74 234 85 252 100 264 116 276 134 286 151 300 167 285 182 278 206 260 220 242 226 218 226 195 222 166 Polygon -16777216 true false 150 149 128 151 114 151 98 145 80 122 80 103 81 83 95 67 117 58 141 54 151 53 177 55 195 66 207 82 211 94 211 116 204 139 189 149 171 152 Polygon -7566196 true true 151 54 119 59 96 60 81 50 78 39 87 25 103 18 115 23 121 13 150 1 180 14 189 23 197 17 210 19 222 30 222 44 212 57 192 58 Polygon -16777216 true false 70 185 74 171 223 172 224 186 Polygon -16777216 true false 67 211 71 226 224 226 225 211 67 211 Polygon -16777216 true false 91 257 106 269 195 269 211 255 Line -1 false 144 100 70 87 Line -1 false 70 87 45 87 Line -1 false 45 86 26 97 Line -1 false 26 96 22 115 Line -1 false 22 115 25 130 Line -1 false 26 131 37 141 Line -1 false 37 141 55 144 Line -1 false 55 143 143 101 Line -1 false 141 100 227 138 Line -1 false 227 138 241 137 Line -1 false 241 137 249 129 Line -1 false 249 129 254 110 Line -1 false 253 108 248 97 Line -1 false 249 95 235 82 Line -1 false 235 82 144 100 bird1 false 0 Polygon -7566196 true true 2 6 2 39 270 298 297 298 299 271 187 160 279 75 276 22 100 67 31 0 bird2 false 0 Polygon -7566196 true true 2 4 33 4 298 270 298 298 272 298 155 184 117 289 61 295 61 105 0 43 boat1 false 0 Polygon -1 true false 63 162 90 207 223 207 290 162 Rectangle -6524078 true false 150 32 157 162 Polygon -16776961 true false 150 34 131 49 145 47 147 48 149 49 Polygon -7566196 true true 158 33 230 157 182 150 169 151 157 156 Polygon -7566196 true true 149 55 88 143 103 139 111 136 117 139 126 145 130 147 139 147 146 146 149 55 boat2 false 0 Polygon -1 true false 63 162 90 207 223 207 290 162 Rectangle -6524078 true false 150 32 157 162 Polygon -16776961 true false 150 34 131 49 145 47 147 48 149 49 Polygon -7566196 true true 157 54 175 79 174 96 185 102 178 112 194 124 196 131 190 139 192 146 211 151 216 154 157 154 Polygon -7566196 true true 150 74 146 91 139 99 143 114 141 123 137 126 131 129 132 139 142 136 126 142 119 147 148 147 boat3 false 0 Polygon -1 true false 63 162 90 207 223 207 290 162 Rectangle -6524078 true false 150 32 157 162 Polygon -16776961 true false 150 34 131 49 145 47 147 48 149 49 Polygon -7566196 true true 158 37 172 45 188 59 202 79 217 109 220 130 218 147 204 156 158 156 161 142 170 123 170 102 169 88 165 62 Polygon -7566196 true true 149 66 142 78 139 96 141 111 146 139 148 147 110 147 113 131 118 106 126 71 box true 0 Polygon -7566196 true true 45 255 255 255 255 45 45 45 butterfly1 true 0 Polygon -16777216 true false 151 76 138 91 138 284 150 296 162 286 162 91 Polygon -7566196 true true 164 106 184 79 205 61 236 48 259 53 279 86 287 119 289 158 278 177 256 182 164 181 Polygon -7566196 true true 136 110 119 82 110 71 85 61 59 48 36 56 17 88 6 115 2 147 15 178 134 178 Polygon -7566196 true true 46 181 28 227 50 255 77 273 112 283 135 274 135 180 Polygon -7566196 true true 165 185 254 184 272 224 255 251 236 267 191 283 164 276 Line -7566196 true 167 47 159 82 Line -7566196 true 136 47 145 81 Circle -7566196 true true 165 45 8 Circle -7566196 true true 134 45 6 Circle -7566196 true true 133 44 7 Circle -7566196 true true 133 43 8 circle false 0 Circle -7566196 true true 35 35 230 person false 0 Circle -7566196 true true 155 20 63 Rectangle -7566196 true true 158 79 217 164 Polygon -7566196 true true 158 81 110 129 131 143 158 109 165 110 Polygon -7566196 true true 216 83 267 123 248 143 215 107 Polygon -7566196 true true 167 163 145 234 183 234 183 163 Polygon -7566196 true true 195 163 195 233 227 233 206 159 sheep false 15 Rectangle -1 true true 90 75 270 225 Circle -1 true true 15 75 150 Rectangle -16777216 true false 81 225 134 286 Rectangle -16777216 true false 180 225 238 285 Circle -16777216 true false 1 88 92 spacecraft true 0 Polygon -7566196 true true 150 0 180 135 255 255 225 240 150 180 75 240 45 255 120 135 thin-arrow true 0 Polygon -7566196 true true 150 0 0 150 120 150 120 293 180 293 180 150 300 150 truck-down false 0 Polygon -7566196 true true 225 30 225 270 120 270 105 210 60 180 45 30 105 60 105 30 Polygon -8716033 true false 195 75 195 120 240 120 240 75 Polygon -8716033 true false 195 225 195 180 240 180 240 225 truck-left false 0 Polygon -7566196 true true 120 135 225 135 225 210 75 210 75 165 105 165 Polygon -8716033 true false 90 210 105 225 120 210 Polygon -8716033 true false 180 210 195 225 210 210 truck-right false 0 Polygon -7566196 true true 180 135 75 135 75 210 225 210 225 165 195 165 Polygon -8716033 true false 210 210 195 225 180 210 Polygon -8716033 true false 120 210 105 225 90 210 turtle true 0 Polygon -7566196 true true 138 75 162 75 165 105 225 105 225 142 195 135 195 187 225 195 225 225 195 217 195 202 105 202 105 217 75 225 75 195 105 187 105 135 75 142 75 105 135 105 wolf false 0 Rectangle -7566196 true true 15 105 105 165 Rectangle -7566196 true true 45 90 105 105 Polygon -7566196 true true 60 90 83 44 104 90 Polygon -16777216 true false 67 90 82 59 97 89 Rectangle -1 true false 48 93 59 105 Rectangle -16777216 true false 51 96 55 101 Rectangle -16777216 true false 0 121 15 135 Rectangle -16777216 true false 15 136 60 151 Polygon -1 true false 15 136 23 149 31 136 Polygon -1 true false 30 151 37 136 43 151 Rectangle -7566196 true true 105 120 263 195 Rectangle -7566196 true true 108 195 259 201 Rectangle -7566196 true true 114 201 252 210 Rectangle -7566196 true true 120 210 243 214 Rectangle -7566196 true true 115 114 255 120 Rectangle -7566196 true true 128 108 248 114 Rectangle -7566196 true true 150 105 225 108 Rectangle -7566196 true true 132 214 155 270 Rectangle -7566196 true true 110 260 132 270 Rectangle -7566196 true true 210 214 232 270 Rectangle -7566196 true true 189 260 210 270 Line -7566196 true 263 127 281 155 Line -7566196 true 281 155 281 192 wolf-left false 3 Polygon -6524078 true true 117 97 91 74 66 74 60 85 36 85 38 92 44 97 62 97 81 117 84 134 92 147 109 152 136 144 174 144 174 103 143 103 134 97 Polygon -6524078 true true 87 80 79 55 76 79 Polygon -6524078 true true 81 75 70 58 73 82 Polygon -6524078 true true 99 131 76 152 76 163 96 182 104 182 109 173 102 167 99 173 87 159 104 140 Polygon -6524078 true true 107 138 107 186 98 190 99 196 112 196 115 190 Polygon -6524078 true true 116 140 114 189 105 137 Rectangle -6524078 true true 109 150 114 192 Rectangle -6524078 true true 111 143 116 191 Polygon -6524078 true true 168 106 184 98 205 98 218 115 218 137 186 164 196 176 195 194 178 195 178 183 188 183 169 164 173 144 Polygon -6524078 true true 207 140 200 163 206 175 207 192 193 189 192 177 198 176 185 150 Polygon -6524078 true true 214 134 203 168 192 148 Polygon -6524078 true true 204 151 203 176 193 148 Polygon -6524078 true true 207 103 221 98 236 101 243 115 243 128 256 142 239 143 233 133 225 115 214 114 wolf-right false 3 Polygon -6524078 true true 170 127 200 93 231 93 237 103 262 103 261 113 253 119 231 119 215 143 213 160 208 173 189 187 169 190 154 190 126 180 106 171 72 171 73 126 122 126 144 123 159 123 Polygon -6524078 true true 201 99 214 69 215 99 Polygon -6524078 true true 207 98 223 71 220 101 Polygon -6524078 true true 184 172 189 234 203 238 203 246 187 247 180 239 171 180 Polygon -6524078 true true 197 174 204 220 218 224 219 234 201 232 195 225 179 179 Polygon -6524078 true true 78 167 95 187 95 208 79 220 92 234 98 235 100 249 81 246 76 241 61 212 65 195 52 170 45 150 44 128 55 121 69 121 81 135 Polygon -6524078 true true 48 143 58 141 Polygon -6524078 true true 46 136 68 137 Polygon -6524078 true true 45 129 35 142 37 159 53 192 47 210 62 238 80 237 Line -16777216 false 74 237 59 213 Line -16777216 false 59 213 59 212 Line -16777216 false 58 211 67 192 Polygon -6524078 true true 38 138 66 149 Polygon -6524078 true true 46 128 33 120 21 118 11 123 3 138 5 160 13 178 9 192 0 199 20 196 25 179 24 161 25 148 45 140 Polygon -6524078 true true 67 122 96 126 63 144 @#$#@#$#@ NetLogo 2.0beta5 @#$#@#$#@ setup all-patches @#$#@#$#@ @#$#@#$#@