What is known? The area of the entire grid of patches is known. "count patches" in a monitor displays that count. The number of turtles that were within radius distance of the center of the circle was known? "count circles" or "count airplanes" or count of whatever the breed was that we had a turtle HATCH when it was within radius distance units from the center patch. The number of turtles that are outside the circle, in our example "count cars" gave this value.
setxy x y The turtle sets its x-coordinate to x and its y-coordinate to y. setxy 0 0 ;; turtle moves to the middle of the center patch setxy random-xcor random-ycor ;; turtle moves to a random point setxy random-pxcor random-pycor ;; turtle moves to center of a random patch WHAT WAS DIFFERENT WHEN WE CHANGED random-xcor to random-pxcor??? WHAT WAS DIFFERENT WHEN WE CHANGED random-ycor to random-pycor??? set-default-shape circles "circle" set-default-shape cars "car" ifelse (sqrt (xcor * xcor) + (ycor * ycor)) <= radius [ hatch-circles 1 [ set color white ] ] [ hatch-cars 1 [ set color yellow ] ] ;; MONITOR with count cars and MONITOR with count circles ;; gives us the counts, so proportion can be calculated. ;; count patches gives total area of the entire turtle grid. ;; -------------
1 9.84 2 13.554 3 16.913 4 19.91 5 22.535 6 24.78 7 26.636 8 28.095 9 29.148 10 29.785 11 30