to setup ca setup-plotting cct 1 [ ; create one turtle set color red set xcor (2 - screen-edge-x) ; set the turtle's initial position and heading set ycor 0 set heading 0 pd ] end to go every 0.05 [ ask turtles [ fd (pi * (screen-edge-y - 2) / 180) * 2 ; move in circle rt 2 if pcolor = color ; if we've come all the way around the circle [set color color + 10] ] do-plot ] end ;;plotting procedures ------------------- to setup-plotting set-current-plot "Turtle Positions" set-plot-y-range (- screen-edge-y) screen-edge-y ; set y range to graphics window size end to do-plot set-current-plot-pen "Xcor" plot xcor-of turtle 0 ; plot xcor -- there's only one turtle, so its id must be 0 set-current-plot-pen "Ycor" plot ycor-of turtle 0 ; plot ycor -- ditto end @#$#@#$#@ GRAPHICS-WINDOW 321 10 697 407 30 30 6.0 1 10 1 1 1 CC-WINDOW 18 10 238 172 Command Center BUTTON 256 23 311 56 NIL setup NIL 1 T OBSERVER T BUTTON 257 68 312 101 go go T 1 T OBSERVER T PLOT 8 193 308 392 Turtle Positions Time Position 0.0 100.0 -30.0 30.0 true true PENS "Xcor" 1.0 0 -65536 true "Ycor" 1.0 0 -16776961 true @#$#@#$#@ WHAT IS IT? ----------- This shows all of the code needed to set up a plot which will display two variables as the model runs. In this case, the two variables are the x-coordinate and the y-coordinate of a turtle. @#$#@#$#@ default true 0 Polygon -7566196 true true 150 5 40 250 150 205 260 250 arrow true 0 Polygon -7566196 true true 150 0 0 150 105 150 105 293 195 293 195 150 300 150 box true 0 Polygon -7566196 true true 45 255 255 255 255 45 45 45 circle true 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 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 @#$#@#$#@ NetLogo 2.0beta4 @#$#@#$#@ setup repeat 100 [ go wait 0.05 ] @#$#@#$#@ @#$#@#$#@