globals [ dragged ;; used by mouse-gui code oldpull ;; used to synch the layout properties sliders oldpush ;; used to synch the layout properties sliders gui-message ;; used by the mouse-gui code ] undirected-link-breed [ edges edge ] edges-own [ weight ;; the weight of this edge in-tree? ;; in this edge in the spanning tree? ] breed [ vertices vertex ] vertices-own [ subtree ;; the ID of the component that this vertex belongs to tested? ;; in the current detection, has this vertex been tested yet? ] to startup setup end to setup ca setup-patches no-display setup-network display ;; now that the network is created, ;; auto-layout the network for a short time ;; hopefully to make is more attractive let t timer + .5 while [ timer < t ] [ layout-spanning-tree ] end to go ;; do the main kruskal thing vis-network-show-all kruskal-spanning-tree vis-network-show-all end to setup-network ;; create a number of vertices ;; connect them into a single component ;; apply weights to the edges set-default-shape vertices "circle" create-vertices vertex-count [ set size .5 setxy random-xcor random-ycor ;; apply default value for subtree id set subtree who ;; apply default value for spanning tree flag set tested? false if who > 0 [ ;; get the set of vertices that this vertex might link with let candidates vertices with [ who < [ who ] of myself ] ;; pick a number of edges to make let edge-count 2 + random 3 ;; can't make more edges than there are vertices ;; so fix number of edges so that it does not exceed ;; available number of vertices ;; (in this simple implementation, ;; vertices are created first, so ;; are numbered from 0 - up, and bear ;; consecutive numbers, so ;; (who - 1) is the number of vertices available ;; to make edges with this vertex. set edge-count min (list edge-count (who - 1) ) ;; address the desired quantity of randomly selected vertexes ;; and make them make links with this vertex ask n-of edge-count candidates [ create-edge-with myself [ ;; apply default value for spanning tree flag set in-tree? false ;; apply weight to the edge set weight (1 + random 9) set thickness 0 set label weight set label-color black ] ] ] ] end to setup-patches ;; color the background in an attractive pattern ask patches [ set pcolor checkered blue 3 .5 ] end to-report checkered [ hue tint diff] ;; patch / turtle reporter ;; report a color to the calling patch ;; this formula produces a checker-board (chess-board) pattern ;; of light and tints of the given color ;; hue = base color ;; tint = base tint of that color (-5...4.9) ;; diff = difference between the base tint and the lighter shade report ( hue + tint + diff * ((pxcor + pycor) mod 2 ) ) end to JPS-spanning-tree-not-really-kruksal no-display ask edges [ set in-tree? false ] ask vertices [ set tested? false ] let sorted-edges sort-by [ [ weight ] of ?1 > [ weight ] of ?2 ] edges if invert? [ set sorted-edges reverse sorted-edges ] let verts-to-test vertices with [ any? my-edges ] foreach sorted-edges [ ask ? [ ;; does this edge make a loop in the tree-so-far? ;; i.e. are both of its vertices already in the tree? ifelse ( in-loop? nobody end1 end2 ) [ ;; yes. skip it. ] [ ;; no. add it to the tree set in-tree? true ask both-ends with [ not tested? ] [ set tested? true set verts-to-test verts-to-test - 1 ] ] ] ;; once all vertices have been tested once, we are done. ;; remaining untested edges must form loops if verts-to-test <= 0 [ stop ] ] end to kruskal-spanning-tree ;; identifies the vertices that compose the minimum (or max, if inverted) spanning tree(s) ;; for the network made of up the vertices and edges currently in existence ;; Note that if graph is not a single component, ;; then the results will be all the spanning trees for each component. ;; edges in the spanning tree are marked with in-tree? = true ;; vertices that have been processed and placed in a tree are marked in-tree? = true ;; no-display ;; reset the testing flag for the vertices ;; place each vertex in its own sub-tree ask vertices [ set tested? false set subtree who ] ;; reset the in-tree flag for the edges ask edges [ set in-tree? false ] let sorted-edges [] ;; sort low to high set sorted-edges sort-by [ [ weight ] of ?1 < [ weight ] of ?2 ] edges if invert? [ set sorted-edges reverse sorted-edges ] ;; store the number of vertices with edges let verts-to-test count ( vertices with [ any? my-edges ] ) if run-slowly? [ vis-network-spanning-tree-only ] foreach sorted-edges [ ;; once all verts with edges have been placed in trees (and thus subtrees merged, as needed), ;; ...this loop is done. ;; any remaining edges are (by definition) loops, since they must connect ;; vertices that are already in the same tree ;; are there any connected vertices not accounted for? if verts-to-test >= 0 [ ;; yes. so lets process this edge ask ? [ ;; get subtrees of the endpoints let subtree-1 [subtree] of end1 let subtree-2 [subtree] of end2 ;; compare them. are they in different sub-trees? if subtree-1 != subtree-2 [ ;; yes! (no loop is formed) ;; this edge in in the spanning tree--mark it set in-tree? true ;; mark one or both verts (which ever is not already in a spanning tree) ;; as being in a tree and ;; decrement the counter of connected vertices yet to be discovered ask both-ends with [ tested? = false ] [ set tested? true set verts-to-test verts-to-test - 1 ] ;; "merge the forests" ;; i.e. connect the entire set of vertices in subtree 2 to subtree 1. ;; this is accomplished by assiging subtree 1 to the subtree variable ;; of all vertices in subtree 2. ;; # one way to do that is to use a one-line with-clause: ;; ---- ask vertices with [ subtree = subtree-2 ][set subtree subtree-1 ] ;; but that address all the vertices, every time we merge a subtree. ;; whether we are adding 1 vertice to the subtree or a hundred. ;; in a large network, that seems like a lot of extra work. ;; # another way to do it is to start with the subtree 2 end-point, ;; and traverse the spanning sub-tree away from the subtree 1 end-point ;; putting the vertices into the subtree as we go along ;; this is a lot more code, even if done recursively. ;; this is a non-recursive implementation. ;; for smaller networks, its not very efficient, ;; but luckily, that doesn't seem to matter as much ;; for larger networks, I think it is more efficient. ;; flow through the vertices in subtree-2, assigning them to subtree 1 ;; ## need to test speed ## ask end2 [ ;; assign to subtree 1 set subtree subtree-1 ;; get set of subtree 2 vertices let connected-vertices edge-neighbors with [ subtree = subtree-2 ] ;; if any, assign them to subtree 1, get next set while [ any? connected-vertices ] [ ask connected-vertices [ set subtree subtree-1 ] set connected-vertices (turtle-set [ edge-neighbors with [ subtree = subtree-2 ] ] of connected-vertices) ] ] ] ;; run-slowly mode is eye-candy to show the edges ;; being connected to the spanning-tree one by one if run-slowly? and in-tree? [ vis-display-edge false ; color the edge let t timer + .05 while [ timer < t ] [ layout-spanning-tree display ] ] ] ] ] end to-report in-loop? [ a b c] ;; a recursive procedure to detect if an edge between node B and C ;; will form a loop in the network that contains A B and C. ;; Node A starts out as nobody, and B is passed as A in recursive calls. ;; this lets us remember the direction B is coming from as we recursively ;; traverse the network, and prevents the traversal from backing up. let result false ask b [ ;; get set of b's edges that are in the tree let tree-edges my-edges with [ in-tree? ] ifelse not any? tree-edges [ ;; if no edges from b in the tree, no loop! set result false ] [ ;; get set of b's vertices attached to b's in-tree edges, ;; that are NOT edges back the way we came (back to a) ;; these may be routes futher along the tree let tree-verts (turtle-set [ other-end ] of tree-edges) with [ self != a ] ifelse not any? tree-verts [ ;; if no way out of here, no loop! set result false ] [ ;; are any of these vertices that might be routes out of here ;; actually C? ifelse any? tree-verts with [ self = c ] [ ;; yes! egad! we've found a loop back to C! set result true ] [ ;; search further along these routes ;; see if any of them lead to c ifelse any? tree-verts with [ in-loop? b self c ] [ set result true ] [ set result false ] ] ] ] ] report result end to vis-network-center-and-scale ;; attempts to center the network in the view ;; then scale the graph to fill the view. ;; doesn't work as expected... ;; ## abandoned pending further work ## stop let cx mean [ xcor ] of vertices let cy mean [ ycor ] of vertices ask vertices [ setxy (xcor - cx) (ycor - cy) ] let mxx min (list max-pxcor max [ pxcor ] of vertices) let mxy min (list max-pycor max [ pycor ] of vertices) let mnx max (list min-pxcor min [ pxcor ] of vertices) let mny max (list min-pycor min [ pycor ] of vertices) let xscale world-width / (abs round (mxx - mnx)) let yscale world-height / (abs round (mxy - mny)) ask vertices [ setxy limitx (xcor * xscale) limity (ycor * yscale) ] end to vis-display-edge [ show-only-tree? ] ;; modifies the display parameters of a single edge ifelse in-tree? [ set color green - 2 set label weight set hidden? false ] [ set color red - 2 set label weight set hidden? show-only-tree? ] ifelse weight=thickness? [ set thickness .1 + .1 * weight ] [ ifelse in-tree? [ set thickness .5 ] [ set thickness 0 ] ] end to vis-network-show-all ;; modifies edge and vertice display parameters ;; to show all the edges ask edges [ vis-display-edge false ] display ask vertices [ set color gray set size 0.5 set label "" ] end to vis-network-spanning-tree-only ;; modifies edge and vertice display parameters ;; to show only the discovered spanning tree ;; if no spanning tree has been found yet, ;; all the edges are hidden ask edges [ vis-display-edge true ] display ask vertices [ set color gray set size 0.5 set label "" ] end to split-network-on-y-axis ;; delete edges along the y axis, thus turning a giant component ;; into at least 2 smaller component. ;; depending on the topology of the current network ;; may create 2 or more components, ;; as well as any number of unconnected vertices ;; first, scale and center the graph vis-network-center-and-scale ;; rotate 90 degrees ask vertices [ setxy ycor (- xcor) ] ;; find edges that have one vertex to the left of y-axis (x < 0) ;; and the other vertex on or to the right of y-axis (x >= 0) ;; kill those vertices. ;; this will split the network into at least two components ;; and may create orphan vertices ask edges with [ first sort ([ xcor] of both-ends) < 0 and last sort ([ xcor] of both-ends) >= 0 ] [ die ] end to-report limitx [ xx ] ;; report an xcor, making sure it is within the view limits report ( max ( list min-pxcor min ( list max-pxcor xx ) ) ) end to-report limity [ yy ] ;; report a ycor, making sure it is within the view limits report ( max ( list min-pycor min ( list max-pycor yy ) ) ) end to vis-network-color ;; does two things ;; pretty-colors the graph, ;; but also does a thing where it finds two endpoints with the largest possible number of hops between them. ;; more than one longest route can exist--this procedure finds one of them, and ;; will randomly select among them if not any? edges with [ in-tree? = true ] [ go ] let depth 1 ask vertices [ set color 0 ] ask edges [ set color 0 ] ask one-of (vertices with [ count my-edges with [ in-tree?] = 1 ]); [ who ] [ trav-set-color depth ] let bus-end-1 max-one-of vertices [ label ] let max-depth-1 [ label ] of bus-end-1 set depth 1 ask vertices [ set color 0 set size .5 ] ask edges [ set color 0 ] ask bus-end-1 [ trav-set-color depth ] let bus-end-2 max-one-of vertices [ label ] let max-depth-2 [ label ] of bus-end-2 set depth 1 ask vertices [ set color 0 set size .5 ] ask edges [ set color 0 ] ask bus-end-2 [ trav-set-color depth ] set bus-end-1 max-one-of vertices [ label ] set max-depth-1 [ label ] of bus-end-2 ask bus-end-1 [ set size 3 ] ask bus-end-2 [ set size 3 ] end to trav-set-color [ depth ] ;; traverse the graph, setting colors and incrementing a counter as we go. set color 5 + 10 * depth set label depth ask my-edges with [ in-tree? and color = 0 ] [ set color 5 + 10 * depth set label depth ask other-end [ if color = 0 [ trav-set-color depth + 1 ] ] ] end to layout-spanning-tree ;; auto-layout the spanning tree layout-spring vertices (edges with [ in-tree? = true ]) layout-pull layout-length layout-push end to layout-spanning-tree-button layout-spanning-tree monitor-mouse set gui-message "" end to-report real-time-monitor ;; run by a monitor, this procedure monitors some gui events ;; and handles them, even when no buttons are pressed monitor-push-pull ifelse gui-message = "" [ set gui-message "x" ] [ monitor-mouse layout-spanning-tree ] report "" end to monitor-mouse ;; detect and perform dragging of vertice in the view with the mouse ifelse is-vertex? dragged [ ifelse mouse-down? [ ask dragged [ setxy mouse-xcor mouse-ycor ] ] [ set dragged nobody ] ] [ if mouse-down? [ ask patch mouse-xcor mouse-ycor [ set dragged one-of vertices-here ] ] ] end to monitor-push-pull ;; if in synch mode, watch the layout push and pull sliders for changes ;; if either slider changes, change the other slider to match if synch? [ifelse layout-push != oldpush [ set oldpush layout-push set layout-pull layout-push set oldpull layout-pull ][ if layout-pull != oldpull [ set oldpull layout-pull set layout-push layout-pull set oldpush layout-push ]] ] end ; ask vertices [ let x (sum [ weight ] of my-edges with [ in-tree? ]) set size min (list 3 (x * .5)) set label precision x 2 ] @#$#@#$#@ GRAPHICS-WINDOW 289 10 794 536 16 16 15.0 1 10 1 1 1 0 0 0 1 -16 16 -16 16 0 1 1 ticks CC-WINDOW 5 613 803 708 Command Center 0 INPUTBOX 11 24 93 84 vertex-count 50 1 0 Number BUTTON 11 87 93 120 reset setup NIL 1 T OBSERVER NIL R NIL NIL BUTTON 11 141 118 174 find-spanning-tree go NIL 1 T OBSERVER NIL F NIL NIL BUTTON 11 433 159 466 layout-spanning-tree layout-spanning-tree-button T 1 T OBSERVER NIL NIL NIL NIL SLIDER 9 494 181 527 layout-length layout-length .1 5 1 .1 1 NIL HORIZONTAL BUTTON 11 308 145 341 show-all-edges vis-network-show-all NIL 1 T OBSERVER NIL NIL NIL NIL BUTTON 11 344 145 377 show-spanning-tree-only vis-network-spanning-tree-only NIL 1 T OBSERVER NIL NIL NIL NIL SWITCH 12 201 102 234 invert? invert? 1 1 -1000 TEXTBOX 99 27 208 83 Remember:\nHit Enter, then click reset after typing a value in the box! 11 0.0 TEXTBOX 108 199 224 245 Invert to find MAX spanning tree, instead of MIN spanning tree. 11 0.0 TEXTBOX 128 140 216 182 Finds the network spanning tree (green) 11 0.0 TEXTBOX 152 344 219 373 Hide the red edges. 11 0.0 SWITCH 13 250 131 283 run-slowly? run-slowly? 0 1 -1000 BUTTON 96 87 159 120 split split-network-on-y-axis NIL 1 T OBSERVER NIL S NIL NIL SLIDER 9 530 181 563 layout-pull layout-pull .01 .99 0.7 .01 1 NIL HORIZONTAL BUTTON 289 538 416 571 NIL vis-network-color NIL 1 T OBSERVER NIL NIL NIL NIL TEXTBOX 167 426 274 493 You can more easily drag vertices with the mouse while this button is active. 11 0.0 SLIDER 9 566 181 599 layout-push layout-push 0 .99 0.38 .01 1 NIL HORIZONTAL TEXTBOX 425 545 785 577 Finds (one of) the longest routes (based on number of nodes, not weight) across the tree. Click again to possibly see other routes. 11 0.0 SWITCH 10 380 146 413 weight=thickness? weight=thickness? 1 1 -1000 MONITOR 183 544 283 589 gui real-time-monitor 3 1 11 SWITCH 187 550 277 583 synch? synch? 1 1 -1000 TEXTBOX 167 89 249 133 Splits graph into multiple components. 11 0.0 @#$#@#$#@ WHAT IS IT? ----------- A model to demonstrate a method of constructing a minumum (or maximum) spanning tree for a network using Kruskal's algorithm. HOW TO USE IT -------------- Press RESET (this is done automatically when the model first loads) to generate a random network graph. Then graph is constructed using a method that guarantees the network will be one giant component, with a fair number of loops and such. Each edge in the graph is assigned a random weight in the range 1 to 100. You can create multiple components by clicking "SPLIT" Press find-spanning-tree to find the minimum-weight spanning tree of the graph. (if INVERT? is On, the maximum-weight spanning tree is found) HOW DOES IT WORK? ----------------- In typical NetLogo idiom, the network is contructed using turtles of breed "vertices" connected by an undirected-link-breed "edges" find-spanning-tree uses Kruskal's Algorithm, with some enhancements to allow early exit from the algorithm as soon as all vertexes in the graph have been processed. To use Kruskal's algorithm: First the vertices are assigned to sub-trees. Each vertice begins assigned to its own unique subtree. The who number is used to provide sub-tree id numbers. Next the edges are sorted by weight. Then, for each edge, in order: If end1 and end2 of the current edge are not already in the same sub-tree, then the edge belongs in the spanning tree. The edge is so marked (IN-TREE? is set to true). Now, end2 and all other vertices in the same subtree as end2 are assigned to the subtree of end1. The unique count of vertice touched by edges added to the spanning tree is kept. If there is another edges to process, and not every vertex has been touched, the next edge is processed. SPECIAL TRICKS -------------- This model features an in-view gui that is active even if no button is pressed. A monitor control (sort of hiding under the synch? switch) runs a procedure that updates the layout and detects mouse dragging and layout-properties sliders moving. Since monitors always run, and since NetLogo 4 updates the view if needed when only monitor code is running (prior NetLogos did not), we can have models that can start running (albeit in a slow mode) as soon as they load. This could be useful for displaying instructions, displaying an "attract" mode to entice users to begin using the model, or, as in this case, to provide a more-or-less full-time in-view gui. CREDITS ------- Thanks to Jim Lyons for his very clean implementation of Kruskal's algorithm, as described in [[ http://en.wikipedia.org/wiki/Kruskal's_algorithm ]], and dirted-up by me. Quote: | * create a forest F (a set of trees), | where each vertex in the graph is a separate tree | * create a set S containing all the edges in the graph | * while S is nonempty | o remove an edge with minimum weight from S | o if that edge connects two different trees, then add it to the forest, | combining two trees into a single tree | o otherwise discard that edge Of course, I had to go clutter it up, but the essense is there. I just didn't get the combining the forests and trees thing, that makes the whole thing so elegent and zippy. @#$#@#$#@ default true 0 Polygon -7500403 true true 150 5 40 250 150 205 260 250 link true 0 Line -7500403 true 150 0 150 300 link direction true 0 Line -7500403 true 150 150 30 225 Line -7500403 true 150 150 270 225 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 15 15 270 Circle -16777216 false false 15 15 270 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.0beta1 @#$#@#$#@ @#$#@#$#@ @#$#@#$#@ @#$#@#$#@ @#$#@#$#@