CS 1025 01 - Week #13 (Apr 15, 17, 19)

Monday, April 15th

  1. Monte Carlo simulation - estimating the area by throwing darts (or turtles, circles and cars).

  2. Estimating the area of a CIRCLE using NetLogo with two breeds of turtles (we used circles and cars).
    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.
  3. Some of the NetLogo statements and techniques used:
     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.
       ;; -------------

Wednesday, April 17th

  1. Assignment (reading) is due on Monday, April 22nd at 8 a.m.

Friday, April 19th

  1. The Data Flyer tool from SHODOR.
     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