This page was automatically generated by NetLogo 4.1RC2. Questions, problems? Contact feedback@ccl.northwestern.edu.

The applet requires Java 5 or higher. Java must be enabled in your browser settings. Mac users must have Mac OS X 10.4 or higher. Windows and Linux users may obtain the latest Java from Sun's Java site.


In order for this to work, this file, your model file (catching-ball-1.4.nlogo), and the file NetLogoLite.jar must all be in the same directory. (You can copy NetLogoLite.jar from the directory where you installed NetLogo.)

On some systems, you can test the applet locally on your computer before uploading it to a web server. It doesn't work on all systems, though, so if it doesn't work from your hard drive, please try uploading it to a web server.

You don't need to include everything in this file in your page. If you want, you can just take the HTML code beginning with <applet> and ending with </applet>, and paste it into any HTML file you want. It's even OK to put multiple <applet> tags on a single page.

If NetLogoLite.jar and your model are in different directories, you must modify the archive= and value= lines in the HTML code to point to their actual locations. (For example, if you have multiple applets in different directories on the same web server, you may want to put a single copy of NetLogoLite.jar in one central place and change the archive= lines of all the HTML files to point to that one central copy. This will save disk space for you and download time for your users.)

powered by NetLogo

view/download model file: catching-ball-1.4.nlogo

WHAT IS IT?

This model shows how a person can catch a ball, without calculating ahead of time where the ball will fall. The catcher simply searches for angle of the ball, and mirrors the change of angle with a change in speed.

The catcher matches the change in the gaze angle with a change in speed.

After a little while the runner changes speed so that gaze angle is held constant.

(I show the catcher as an arrow so that we can clearly see the angle of gaze)

Although angle and distance are different domains, the catcher matches change in one domain with change in the other domain. Like a mirror image, we see differences at one level (left and right reversed), but at a higher order we see symmetry, constancy--a change in one domain is matched with the change in the other domain. When the gaze angle decreases, the catcher decreases speed.

As a result, we see the catcher eventually adjusting her position so that the angle of gaze is constant. This is a case of higher-order emerging from a mirroring of two lower-order searches.

Prior research on how people catch balls assumed that catchers calculate (unconsciously) the parabolic curve of a ball and also the point where that parabolic curve intersects with the ground, then run to the point. If that were true then catchers would not overrun then move forward, nor would they run into walls etc. Moreover, calculating a parabola from observation of trajectory, and estimating where that parabola would meet near the ground etc, would be very difficult, and computationally "expensive."

This model shows a simple alternative, based on my model of mirrored search. Mirrored search takes less effort, and you don't have to know where the ball will fall. Instead you just calculate recent changes in angle, adapting as that angle changes. In this model, the catcher uses no trigonometry. If the gaze angle increases (at all), then the catcher speeds up by a set amount. If the angle decreases (at all), then the catcher slows down. The extent of the angle change is ignored. Very simple.

As a result, the catcher often overruns, runs a little to far at first, then reverses direction (speed is eventually negative), because they don't know ahead of time where the ball will end up. This is what we see real ball players often do.


HOW IT WORKS

The catcher has no "knowledge" of where the ball will fall. The catcher only knows how the angle of the ball changes--the change in the angle of the ball relative to the catcher, over some time period (a lapse in seconds, set by the user of the model). The only thing the catcher does other than search for the angle change, is change her speed, decreasing the speed if she sees the angle of the ball decrease, increasing speed if she sees the angle increase. The size of the angle change is ignored, to show how very simple the dynamics can be, under mirrored search. Yet, it doesn't always work. Sometimes the catcher misses, especially under certain conditions (you can experiment and find these).

This is what I call a mirrored search--a mirroring between the search for the angle of the ball and the search for a speed and direction to run. Like a mirror, the searches are different at one level, the lower order level. But soon a higher-order "sameness" emerges, just as a mirror image is the same at a higher order.


HOW TO USE IT

Hit SETUP. Hit GO. Hit throw.

(If you hit GO again, the model stops running. So if you accidentally hit the buttons too many times or in the wrong order, nothing happens--in that case just hit GO again).


THINGS TO TRY

You can adjust the initial throw angle. At certain angles, the catcher has a harder time, depending on the initial running speed of the catcher. So also try adjusting the initial running speed. The catcher does not always catch the ball, especially if the initial running speed is too far off.

Try adjusting the time (in seconds) the catcher takes to calculate the change of the angle of the ball. This is the time elapsed between the gaze-angle time 1 and the new gaze-angle at time 2 (to gauge the rate of the angle change). If that time elapsed is too long, then the person can't keep up with the ball, and will not catch it.

You can also adjust the initial power of the throw, as well as the angle.

Regardless of the change in settings affecting where the ball goes (the angle and power), the catcher's strategy (program) remains exactly the same: just note the recent change in angle, and match that with a change in speed)


THINGS TO NOTICE

Notice that the gaze angle is eventually constant and that the catcher often runs a little too far then heads back (but the gaze angle doesn't change).

The catcher searches for:

1) a speed and direction to run, including change of speed.

2) the angle of the ball, and the change of angle.

The model links the above two searches, so that an decrease in the angle of the ball, relative to the catcher, results in a decrease in velocity (the velocity can even be negative, in which case the catcher's direction reverses).

Initially it seems the catcher conducts each search in parallel. That is, you can see the catcher's gaze angle changing, and you see her run, but we don't see the link between the two at first. If the ball is thrown, then the catcher runs in that direction. This is a simple search, for a direction and speed. If the angle of the ball, relative to the catcher, increases, then the catcher changes his gaze (keeping the "eye on the ball"). That's what we see happen at first.

But soon, we see the mirroring between the two emerge, we see a higher-order--the gaze angle of the catcher becomes fixed. That is, the catcher changes speed so as to maintain the gaze angle. It just so happens that this usually results in successful catching. The catcher in this model has no knowledge of where the ball will fall. Because the catcher only knows to reduce speed when gaze angle increases (very limited, "local" knowledge, no global knowledge calculation of the parabola of the ball etc.). For that reason the runner changes direction, sometes runs into the wall, so as to mirror the speed with change of angle.

The parameters of the above searches matter:
If the time between estimating the angle is too long, the person can't catch the ball.
If the initial speed is too fast or slow, the person can't catch the ball.

This is based on Dr. Keane's model of mirrored search.


RELATED MODELS

See Dr. Keane's model of mirrored search, as explanation for bird flocking.


CREDITS AND REFERENCES

Chris Keane designed this program, based on his model of mirrored search.
The finding that ball catchers fix their gaze has been summarized by Gerd Gigerenzer.

The parabolic projectile curve and trail, and program that "fakes" having no ceiling for a projectile, borrowed from the netlogo "projectile attack" model. Wilensky, U. (2008). http://ccl.northwestern.edu/netlogo/models/ProjectileAttack.
All other components, including the catcher dynamics, gaze-angle change etc., mirroring between search for the ball (changing gaze-angle) and speed (changing speed based on changing gaze angle) developed and programmed by Dr. Keane.


PROCEDURES

breed [ catchers catcher ]
breed [ throwers thrower ]
breed [ balls ball ]

globals [ x-vel y-vel velocity previous-wall-height previous-wall-pos wall-height 
   current-running-speed]

catchers-own [gazeangle gazeangle2]

to setup
  clear-all
  set-default-shape throwers "person"
  set-default-shape balls "ball"
  set current-running-speed initial-speed
  set wall-height 5
  ask patches [ set pcolor 97 ]
  ask patches with [ pycor < -15 ]
    [ set pcolor black ]
  create-throwers 1
  [
    set heading angle-of-throw 
    setxy -16 -14.2
    set color green - 2
    set size 3
          ]
  create-catchers 1
  [
    set shape "arrow"
    setxy 0 -14
    set color 8
    set size 3
    set heading 270
  ]
 
  ask patches with [ pycor > -16 ]
  [
    ifelse (pycor < wall-height - 15 and pxcor = distance-of-wall-from-center )
      [ set pcolor black ]
      [ set pcolor 97 ]
  ]
end

to go
  ask throwers [ set heading angle-of-throw ]
  every .05
  [
    ask balls
    [
      setxy (xcor + x-vel) (ycor + y-vel)
      set y-vel (y-vel - .01)
      set velocity sqrt (( x-vel ^ 2 ) + (y-vel ^ 2))
      if (velocity > 1)
      [
        set x-vel x-vel / velocity
        set y-vel y-vel / velocity
        set velocity 1
      ]
      check-ball
    ] 
    ask catchers [ setxy (xcor + current-running-speed / 100) (ycor) ]
ask catchers [ifelse not any? balls [set heading 270] [face one-of balls]]
ask catchers [set gazeangle heading]
every check-new-gaze-angle-every: [ask catchers [set gazeangle2 heading]]
ask catchers
    [if gazeangle2 < gazeangle
         [ set current-running-speed (current-running-speed + 0.2) ]]
ask catchers
    [if gazeangle2 > gazeangle
         [ set current-running-speed (current-running-speed - 1) ]]
ask catchers [   if not any? balls [set current-running-speed 0]]
  ]
   display
end

to throw
  ask catchers [setxy 0 -14]
  set current-running-speed initial-speed
  if not any? balls
  [
    ask throwers
    [
      hatch-balls 1
      [
        set size 1
        set color black
        set x-vel ( sin angle-of-throw * ( Power / 100 ))
        set y-vel ( cos angle-of-throw * ( Power / 100 ))
        set velocity Power / 100
      ]

    ]
  ]
end

to check-ball
  if ( pycor = -17 and hidden? = false )
      [ hide-turtle ]
  if ( pycor = 17 and hidden? = true )
      [ show-turtle ]
  if ( hidden? = false )
  [
     if ( xcor > 17 or ycor < -15 or pcolor = gray )
       [ die ]
  if (show-previous-ball-path? = true)   
    [set pcolor scale-color sky velocity 2 0]
       ]

   end

; Chris Keane designed this program, based on his model of mirrored search.
; The idea that ball catchers fix their gaze is based on the data of other researchers, summarized by Gerd Gigerenzer.
; Dr. Keane borrowed the parabola projectile curve and trail from the netlogo "projectile attack" model. All other components, including the catcher dynamics, developed and programmed by Dr. Keane.
; Netlogo software copyright notice:
; *** NetLogo 4.1RC2 Model Copyright Notice ***
;
; Copyright 2008 by 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.

; *** End of NetLogo 4.1RC2 Model Copyright Notice ***