links-own [age max-age] ;; links represent sexual relations, age tells how old a relation is; max age is when it will be broken turtles-own [ adherence ;; in adherence-based mode, the preferred length of a relationship experience ;; eufemism for how many sexual partners the agent has had, ranges from 0 to... whatever t-experience ;; experience in a time window (to study sampling) infected? ;; if true, the person is infected. It may be infecting or not infecting. infecting? ;; if true, the person is infecting (hence, infected? must also be true). infection-length ;; how long an agent has been infected own-component-size ;; variable for identifying connected components explored? ;; helper variable for the above ] globals [ kamu component-size ;; number of turtles explored so far in the current component giant-component-size ;; number of turtles in the giant component giant-start-node ;; node from where we started exploring the giant component virgins-mate ;; can virgins (ie agents with zero experience) mate with virgins? makes a big difference ] ;;;;;;;;;;;;;;;;;;;;;;;; ;;; Setup Procedures ;;; ;;;;;;;;;;;;;;;;;;;;;;;; to setup clear-all ;;ask patches [set pcolor white] set-default-shape turtles "circle" ;; make the initial network of two turtles and an edge make-initialnode nobody ;; first node, unattached make-initialnode turtle 0 ;; second node, attached to first node crt num-nodes - 2 [set color sky + 2] ;; lonely agents wait in an outside circle... layout-circle turtles with [not any? link-neighbors] max-pycor - 1 set virgins-mate 0 if virgins-can-mate [set virgins-mate 1] ask turtles [set infected? false set infecting? false] if adherence-matters [ let id 0 repeat num-nodes - 2 [ask turtle id [set adherence (max-adherence - (max-adherence - 1) * id / num-nodes) set id id + 1] ] ] end ;;;;;;;;;;;;;;;;;;;;;;; ;;; Main Procedures ;;; ;;;;;;;;;;;;;;;;;;;;;;; to go ;; new edge is green, old edges are recolored yellow NOTE> now changed to all is yellow ask links [ set color yellow set age age + 1] ;; this is just housekeeping ask turtles [ if infected? [ set infection-length infection-length + 1 ]] let num-times multiples-in-a-step ;; this is how many new links are formed in a single time step, ;; useful to have less lonely agents: total edge number is a function of this number repeat num-times ;; this is how the above is done... [ make-node find-partner ;; find first partner & use it as attachment point for connecting (or making in the net) another node ] ;; infection part ask turtles [infect] ask turtles [check-symptoms] ask turtles [assign-color] ;; infection part ends ;; so far the real stuff, below this point just link breakup, plotting and more of housekeeping tick ifelse die-by-age [ask links [if (age > max-age) [die]]] [ask links [if (random-float 100) < (100 * p) [die]]] ;; either links have a max age to die, or die by probability p layout ;; show the net layout-circle turtles with [not any? link-neighbors] max-pycor - 1 ;; the lonely agents go to the outer circle if show-components ;; produce and show the histogram of connected network components [ find-all-components ] do-plotting ;; all the clumsy plotting stuff... end ;; used for creating the first link to make-initialnode [old-node] crt 1 [ set color lime + 3 if old-node != nobody [ let link-max-age min sentence adherence [adherence] of old-node ;; we must compute this before jumping to link context but only needed in adherence mode create-link-with old-node [ set color yellow set age -1 * random initial-age-randomization ifelse adherence-matters [ set max-age link-max-age ] [set max-age age-limit] ] ;; was green.. now use same yellow as old links set experience 1 ;; if you have sex, you are not a virgin, are you... set t-experience 1 move-to old-node fd 8 ;; position the newly connected node near its partner ] ] end ;; used for creating links between two different nodes where... to make-node [old-node] ;; ...old-node is the "proactive partner" that looks for a new mate via make-node (better called make-contact) let new-node nobody ;; ...and new-node is her new lover, ie. nobody yet ifelse preferential-choice and assortative-mating ;; assortative mating means first of all that the new guy will not be necessarily someone w/o a partner. ;; quite the opposite, agents with greater experience are more likely to be selected as a partner. ;; (BUT this model is NOT double assortative, where like begets like: small with small, great with great). ;; ;; the logic is that first an old-node was selected via a find-partned call in the GO procedure. ;; in preferential mode, this operation picks an agent with a probability proportional to its experience. ;; ;; then, in assortative mode, we dont just randomly pick any lonely agent secondly (anybody can be lonely here, ;; not just those w/o a partner), but we find one, again, with probability proportional to its experience. ;; ;; so, highly probable events are hubs w/ hubs, medium p events are hubs w/ virgins, less probable are virgins w/ virgins [set new-node find-lonely] [set new-node one-of turtles with [not any? link-neighbors]] ;; the basic case: new-node is a random pick from those w/o a partner if new-node = old-node [stop] ;; self-sex is not real sex... so no link is formed (can see the effect on the plot sometimes...) ask new-node ;; so we have a new guy... [ if old-node != nobody ;; ... and unless the old guy dies or otherwise inexists (it happened...), a link is formed, tadamm. [ let link-max-age min sentence adherence [adherence] of old-node ;; we must compute this before jumping to link context but only needed in adherence mode create-link-with old-node [ set color yellow set age -1 * random initial-age-randomization ifelse adherence-matters [ set max-age link-max-age ] [set max-age age-limit] ] ;; was green.. now use same yellow as old links ] ;move-to old-node ;; uncomment this experimentally and then decide fd -1 ;; a drawing trick, dont let newly connected nodes collapse, no matter what set experience experience + 1 ;; experience grows for both nodes of a new link set t-experience t-experience + 1 ask old-node [ set experience experience + 1 set t-experience t-experience + 1] ] end to-report find-partner ;; dont let the name trick you, this finds a FIRST guy, ie. the proactive one, looking for a mate let partner nobody if serial-monogamy ;; serial monogamy = only agents w/o partner can mate. implies virgins-can-mate or nothing happens at startup [set partner one-of turtles with [count link-neighbors = 0] report partner] ifelse preferential-choice ;; there are two modes here, preferential, which uses code from a lottery w/ multiple tickets ;; and random uniform, below the preferential, which picks any one guy and finito. ;; [let total random-float sum [experience + virgins-mate] of turtles ;; a bit of a trick here: if virgins can mate, we shift experience by 1 so they have one ticket. ask turtles [ let nc experience + virgins-mate ;; if there's no winner yet... if partner = nobody [ ifelse nc > total [ set partner self ] [ set total total - nc ] ] ] report partner ] ;; below this line, the non-preferential mode, ie. random uniform selection of partner [ ifelse virgins-can-mate [set partner one-of turtles][set partner one-of turtles with [experience > 0]] ;; select any agent, or anyone with experience report partner ] end to-report find-lonely ;; misleading name again, lonely is the proactive agent that seeks a partner, we call this function in assortative mode ;; which means more experienced, and probably linked, agents have a higher chance to be selected let total random-float sum [experience + 1] of turtles ;; here the plus one is a must, or nothing ever happens at startup, where everybody has zero let partner nobody ask turtles [ let nc (experience + 1) ;; if there's no winner yet... if partner = nobody [ ifelse nc > total [ set partner self ] [ set total total - nc ] ] ] report partner end ;;;;;;;;;;;;;;;;;;;; ;; Infection part ;; ;;;;;;;;;;;;;;;;;;;; to random-infection ;; you may get infected only if you are not a virgin and not currently inactive let nums (count turtles with [count link-neighbors > 0]) * actives-to-infect / 100 ask n-of nums turtles with [count link-neighbors > 0] [set infected? true] ask turtles [ if infected? [ ifelse (experience = 0) or (count link-neighbors = 0) [ set infected? false set infecting? false] [ set infection-length random-float stop-infecting set infecting? true set color red]] ] end to experienced-infection ;; as random infection, except that we infect agents with most experience let nums (count turtles with [count link-neighbors > 0]) * actives-to-infect / 100 ask max-n-of nums turtles [experience] [set infected? true] ask turtles [ if infected? [ ifelse (experience = 0) or (count link-neighbors = 0) [ set infected? false set infecting? false] [ set infection-length random-float stop-infecting set infecting? true set color red]] ] end to infect ;; turtle procedure if (count link-neighbors > 0) and infected? and infecting? [ ask link-neighbors [ if random-float 100 < p-of-infection-per-step [ set infected? true set infecting? true ] ] ] end to check-symptoms if (infection-length > stop-infecting) [set infecting? false] end to-report %infected ifelse any? turtles [ report (count turtles with [infected?] / count turtles) * 100 ] [ report 0 ] end to-report num-infected report (count turtles with [infected?]) end to-report num-infecting report (count turtles with [infecting?]) end to-report %infecting ifelse any? turtles [ report (count turtles with [infecting?] / count turtles) * 100 ] [ report 0 ] end to-report num-active report (count turtles with [count link-neighbors > 0]) end to-report %infected-active ifelse any? turtles [ report (count turtles with [infected? and count link-neighbors > 0] / count turtles with [count link-neighbors > 0]) * 100 ] [ report 0 ] end ;; to find all the connected components in the network, their sizes and starting turtles to find-all-components ask turtles [ set explored? false set own-component-size 0] ;; keep exploring till all turtles get explored loop [ ;; pick a node that has not yet been explored let starting-agent one-of turtles with [ not explored? ] if starting-agent = nobody [ stop ] ;; reset the number of turtles found to 0 ;; this variable is updated each time we explore an ;; unexplored node. set component-size 0 ;; at this stage, we recolor everything to light gray ask starting-agent [ explore ] ask starting-agent [ set own-component-size component-size] ;; the explore procedure updates the component-size variable. ;; so check, have we found a new giant component? if component-size > giant-component-size [ set giant-component-size component-size set giant-start-node starting-agent ] ] end to assign-color ;; turtle procedure ifelse (experience = 0) [set color sky + 2 set infected? false set infecting? false] [ifelse not infected? [ set color lime + 3 ] [ ifelse infecting? [ set color red ] [ set color gray ] ]] end ;; Finds all turtles reachable from this node (and recolors them) to explore ;; node procedure if explored? [ stop ] set explored? true set component-size component-size + 1 ;; color the node ;set color new-color ask link-neighbors [ explore ] end ;;;;;;;;;;;;;;;; ;;; Plotting ;;; ;;;;;;;;;;;;;;;; to do-plotting ;; plotting procedure set-current-plot "Degree Distribution" let max-experience max [experience] of turtles set-plot-x-range 1 (max-experience + 1) set-current-plot-pen "cumulative-degree" plot-pen-reset histogram [experience] of turtles set-current-plot-pen "degree" plot-pen-reset ;; erase what we plotted before let max-degree max [count link-neighbors] of turtles ; set-plot-x-range 1 (max-degree + 1) ;; + 1 to make room for the width of the last bar histogram [count link-neighbors] of turtles ;; for the next plot, the axes are logarithmic, so we can't ;; use "histogram-from"; we have to plot the points ;; ourselves one at a time set-current-plot "Degree Distribution (log-log)" set-current-plot-pen "degree" plot-pen-reset ;; erase what we plotted before ;; the way we create the network there is never a zero degree node, ;; so start plotting at degree one let degree 1 while [degree <= max-degree] [ let matches turtles with [count link-neighbors = degree] if any? matches [ plotxy log degree 10 log (count matches) 10 ] set degree degree + 1 ] set-current-plot-pen "degree-dot" plot-pen-reset ;; erase what we plotted before ;; the way we create the network there is never a zero degree node, ;; so start plotting at degree one set degree 1 while [degree <= max-degree] [ let matches turtles with [count link-neighbors = degree] if any? matches [ plotxy log degree 10 log (count matches) 10 ] set degree degree + 1 ] set-current-plot-pen "cumulative-degree" plot-pen-reset ;; erase what we plotted before ;; the way we create the network there is never a zero degree node, ;; so start plotting at degree one let cumulative-degree 1 while [cumulative-degree <= max-experience] [ let cumulative-matches turtles with [experience = cumulative-degree] if any? cumulative-matches [ plotxy log cumulative-degree 10 log (count cumulative-matches) 10 ] set cumulative-degree cumulative-degree + 1 ] set-current-plot-pen "timed-degree" plot-pen-reset let max-t-experience max [t-experience] of turtles set cumulative-degree 1 while [cumulative-degree <= max-t-experience] [ let cumulative-matches turtles with [t-experience = cumulative-degree] if any? cumulative-matches [ plotxy log cumulative-degree 10 log (count cumulative-matches) 10 ] set cumulative-degree cumulative-degree + 1 ] set-current-plot-pen "cumulative-degree-dot" plot-pen-reset ;; erase what we plotted before ;; the way we create the network there is never a zero degree node, ;; so start plotting at degree one set cumulative-degree 1 while [cumulative-degree <= max-experience] [ let cumulative-matches turtles with [experience = cumulative-degree] if any? cumulative-matches [ plotxy log cumulative-degree 10 log (count cumulative-matches) 10 ] set cumulative-degree cumulative-degree + 1 ] let cumulative-links sum [experience] of turtles ;; set-current-plot "Density" set-current-plot-pen "current" plot count links / (num-nodes * num-nodes) set-current-plot-pen "summative" plot cumulative-links / (num-nodes * num-nodes * 2) ;; two nodes is one link, divide by 2 ;; set-current-plot "Populations" set-current-plot-pen "HIV-" plot count turtles with [not infected?] ;and count link-neighbors > 0] set-current-plot-pen "HIVall" plot count turtles with [infected?] set-current-plot-pen "HIV+" plot count turtles with [infecting?] ;; set-current-plot "Experience" histogram [experience] of turtles set-current-plot "Link-age" set kamu [age] of links histogram kamu ;; if show-components [ set-current-plot "Component Distribution" clear-plot histogram [own-component-size] of turtles with [own-component-size > 0] ] end to-report num-components report count turtles with [own-component-size > 1] end ;;;;;;;;;;;;;; ;;; Layout ;;; ;;;;;;;;;;;;;; ;; resize-nodes, change back and forth from size based on degree to a size of 1 to resize-nodes ifelse all? turtles [size <= 1] [ ;; a node is a circle with diameter determined by ;; the SIZE variable; using SQRT makes the circle's ;; area proportional to its degree ask turtles [ set size sqrt experience ] ] [ ask turtles [ set size 1 ] ] end to layout ;; the number 3 here is arbitrary; more repetitions slows down the ;; model, but too few gives poor layouts repeat 3 [ ;; the more turtles we have to fit into the same amount of space, ;; the smaller the inputs to layout-spring we'll need to use let factor sqrt count turtles ;; numbers here are arbitrarily chosen for pleasing appearance layout-spring turtles with [any? link-neighbors] links (1 / factor) (7 / factor) (1 / factor) display ;; for smooth animation ] ;; don't bump the edges of the world let x-offset max [xcor] of turtles + min [xcor] of turtles let y-offset max [ycor] of turtles + min [ycor] of turtles ;; big jumps look funny, so only adjust a little each time set x-offset limit-magnitude x-offset 0.1 set y-offset limit-magnitude y-offset 0.1 ask turtles [ setxy (xcor - x-offset / 2) (ycor - y-offset / 2) ] end to-report limit-magnitude [number limit] if number > limit [ report limit ] if number < (- limit) [ report (- limit) ] report number end ; Copyight 2010 by George Kampis. Using code by Uri Wilensky and others as execution modules. @#$#@#$#@ GRAPHICS-WINDOW 473 10 866 424 45 45 4.21 1 10 1 1 1 0 0 0 1 -45 45 -45 45 1 1 1 ticks PLOT 11 427 468 604 Degree Distribution (log-log) log(degree) log(# of nodes) 0.0 0.3 0.0 0.3 true false PENS "degree" 1.0 0 -955883 true "cumulative-degree" 1.0 0 -7500403 true "degree-dot" 1.0 2 -16777216 true "cumulative-degree-dot" 1.0 2 -16777216 true "timed-degree" 1.0 0 -13345367 true PLOT 11 257 230 424 Degree Distribution degree # of nodes 0.0 10.0 0.0 10.0 true false PENS "degree" 1.0 1 -955883 true "cumulative-degree" 1.0 1 -7500403 true BUTTON 203 142 269 175 NIL setup NIL 1 T OBSERVER NIL NIL NIL NIL BUTTON 292 179 369 212 NIL go T 1 T OBSERVER NIL NIL NIL NIL BUTTON 202 179 287 212 go-once go NIL 1 T OBSERVER NIL NIL NIL NIL BUTTON 203 216 305 249 redo layout layout T 1 T OBSERVER NIL NIL NIL NIL BUTTON 311 217 421 250 resize nodes resize-nodes NIL 1 T OBSERVER NIL NIL NIL NIL SLIDER 193 10 365 43 age-limit age-limit 0 1000 250 1 1 NIL HORIZONTAL TEXTBOX 482 389 601 420 blue = virgin\ngreen = experienced\n 11 0.0 1 SLIDER 24 217 189 250 multiples-in-a-step multiples-in-a-step 0 3 1 1 1 NIL HORIZONTAL SLIDER 193 44 365 77 initial-age-randomization initial-age-randomization 0 100 100 1 1 NIL HORIZONTAL PLOT 871 427 1245 603 Component Distribution Size Number 2.0 50.0 0.0 10.0 true false PENS "default" 1.0 1 -16777216 true SWITCH 1086 448 1238 481 show-components show-components 1 1 -1000 SWITCH 23 147 188 180 virgins-can-mate virgins-can-mate 1 1 -1000 SWITCH 23 182 188 215 assortative-mating assortative-mating 1 1 -1000 TEXTBOX 117 288 223 316 red = current\ngray = summative 11 0.0 1 SWITCH 23 113 188 146 preferential-choice preferential-choice 0 1 -1000 SLIDER 319 134 468 167 num-nodes num-nodes 0 1000 1000 1 1 NIL HORIZONTAL PLOT 234 257 468 424 Density time density 0.0 10.0 0.0 0.0010 true false PENS "current" 1.0 0 -2674135 true "summative" 1.0 0 -7500403 true SWITCH 194 79 307 112 die-by-age die-by-age 0 1 -1000 TEXTBOX 422 83 465 125 ends by age or by p 11 0.0 1 SLIDER 310 79 418 112 p p 0 0.01 0.0020 0.001 1 NIL HORIZONTAL TEXTBOX 371 10 460 46 age = age of relationship 11 0.0 1 BUTTON 872 10 1036 43 NIL random-infection NIL 1 T OBSERVER NIL NIL NIL NIL SLIDER 873 79 1037 112 actives-to-infect actives-to-infect 0 100 2 1 1 NIL HORIZONTAL SLIDER 873 172 1036 205 stop-infecting stop-infecting 0 500 250 1 1 NIL HORIZONTAL MONITOR 1129 104 1243 149 NIL %infected 1 1 11 SLIDER 873 137 1036 170 p-of-infection-per-step p-of-infection-per-step 0 10 1 1 1 NIL HORIZONTAL TEXTBOX 1040 92 1095 110 percent 11 0.0 1 TEXTBOX 1039 177 1105 209 weeks after infection 11 0.0 1 PLOT 871 247 1244 423 Populations NIL NIL 0.0 10.0 0.0 10.0 true true PENS "HIV-" 1.0 0 -10899396 true "HIV+" 1.0 0 -2674135 true "HIVall" 1.0 0 -7500403 true MONITOR 1130 151 1243 196 NIL %infected-active 1 1 11 MONITOR 1129 10 1243 55 NIL num-infected 17 1 11 MONITOR 385 170 468 215 NIL num-active 17 1 11 MONITOR 1129 57 1243 102 NIL num-infecting 17 1 11 BUTTON 872 44 1036 77 NIL experienced-infection NIL 1 T OBSERVER NIL NIL NIL NIL MONITOR 1130 198 1243 243 NIL %infecting 1 1 11 TEXTBOX 875 124 913 142 then... 11 0.0 1 SWITCH 22 78 188 111 serial-monogamy serial-monogamy 1 1 -1000 SWITCH 22 10 189 43 adherence-matters adherence-matters 1 1 -1000 SLIDER 22 44 189 77 max-adherence max-adherence 0 1500 210 10 1 NIL HORIZONTAL TEXTBOX 386 46 474 88 bias: age of link when born 11 0.0 1 PLOT 675 427 865 604 Link-age NIL NIL 0.0 2000.0 0.0 20.0 true false PENS "default" 10.0 1 -16777216 true PLOT 473 427 671 604 Experience NIL NIL 0.0 150.0 0.0 1.0 true false PENS "default" 1.0 1 -16777216 true BUTTON 317 447 462 480 Reset sampling window ask turtles [set t-experience 0] NIL 1 T OBSERVER NIL NIL NIL NIL TEXTBOX 398 483 461 511 plots blue 11 0.0 1 MONITOR 1127 481 1238 526 NIL num-components 17 1 11 @#$#@#$#@ WHAT IS IT? ----------- A sexual contact and HIV spreading network model. HOW IT WORKS ------------ HOW TO USE IT ------------- THINGS TO NOTICE ---------------- THINGS TO TRY ------------- KNOWN ISSUES ------------------- Experience handling (adding plus one to give nonzero chance for virgins to mate) changes proportions slightly in virgin mode. Perhaps add +1 experience at setup but never more is better. COPYRIGHT NOTICE ---------------- Copyright 2010 George Kampis using code excerpts from Uri Wilensky. 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. @#$#@#$#@ 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.1 @#$#@#$#@ set layout? false set plot? false setup repeat 300 [ go ] repeat 100 [ layout ] @#$#@#$#@ @#$#@#$#@ @#$#@#$#@ @#$#@#$#@ 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 @#$#@#$#@ 0 @#$#@#$#@