PURSUIT

WHAT IS IT? ----------- In this model there is one leader
turtle and a group of follower turtles.

The leader moves along a path according to a preselected
formula (such as y = x^2).  The followers move toward the
leader with each step.  The followers update their pursuit
path each time the leader moves.

Have a little fun- hide the leader and try to guess the path
along which it is moving.  Clues to the leaderıs path are
found by observing the paths of the followers.

HOW TO USE IT ------------- General Settings:

Use the NUMFOLLOW slider to select how many followers will
participate in the pursuit.  If exactly 4 followers are
selected, they will be placed at the four corners of the
screen.  If a different number is selected, the followers
will be placed at random locations on the screen.

Use the STEPSIZE slider to decide how far from its current
location a follower will move after each step of the leader.

How steps are implemented: -  The leader starts at the left
edge of the screen. -  The leader always moves from left to
right by one unit increments along the x-axis.* -  The
leaderıs y coordinate is based on the selected formula and
the current x coordinate.  For example, if the current
formula is y = x^2 and the leaderıs current xcor value is
-3, the ycor value will be set to 9. -  The followerıs
heading is set using the TOWARDS-NOWRAP function. - 
Followers move forward in increments of STEPSIZE.

* For the trigonometric functions, an integer counter is
used for the x coordinate values.  This counter is then
scaled so that two periods of the function will be visible
on the screen.



X and Y Axes:

The light gray lines that are drawn once SETUP is pressed
are the x-axis and the y-axis.



Leader Switches:

SHOWLEADER makes the leader shown or hidden.  This switch
must be set before SETUP is pressed. When the switch is set
to 1, the leader will be visible. When the switch is set to
0, the leader will be hidden.

SHOWLEADERTRAIL, when turned on, causes the leader to stamp
at each location determined by its formula.  This switch may
be turned on and off at any time during the pursuit. When
the switch is set to 1, the trail will be visible. When the
switch is set to 0, the trail will be hidden.

RANDOMFORMULA, when turned on, uses a randomly selected
formula for the leader. When the switch is set to 1, the
formula will be randomly selected. When the switch is set to
0, the formula will be selected by the user by editing the
move-leader procedure.

Press SETUP when all of the above selections have been made.
This will create the leader and the selected number of
followers.

Press STEPONCE to make the leader increment its xcor value
by one and to make the followers take one step toward the
leader.

Press GO to make the leader and followers move continuously.
To stop them, press the GO button again.


RUNNING THE MODEL ----------------- Try starting with 4
followers with a step size of 1. Do not show the leader or
the leaderıs trail.

Use settings so that the graphics window is square.

Press SETUP then press GO.

See if you can guess the formula the leader is using by
observing the path of each follower.

For each of the next questions, consider the follow-up
questions Why or why not? How can you tell?

Does the speed of the leader seem to change over time?

Does the speed of a follower seem to change over time?

Do all followers travel at the same speed?

What can you tell about the leaderıs formula based on the
path of each follower?

What traits of each followerıs path give you information
about the leaderıs formula?  Which of these traits do you
find most helpful?  Why?



To Change the Formula for the Leader:

A number of formulas have been stored in the procedures for
this model.  They are stored using the CONSTANTS feature. 
To explicitly make a given formula active, set RANDOMFORMULA
to 0 and edit the procedure named MOVE-LEADER.  Within that
procedure is a list of formula names.  The formula name that
is in square brackets at the end of the conditional
statement that begins with "if (choice = 99)" will be used.

Note:  Since formulas must be seen to be changed, it will be
more fun to select the formula randomly.

See the ŒEXTENDING THE MODELı section for instructions on
how to add your own formulas to the model.


THINGS TO NOTICE ---------------- There are several
characteristics of each followerıs path and the leaderıs
trail that are worth noting.


Follower Path Slope:

What does it mean if the slope of the path is increasing?
What does it mean if the slope of the path is decreasing?
What does it mean if one section of the path has a steeper
slope than another part? What does it mean if the slope of
the path is constant?

To think about the slope of a path, consider whether the
path appears to be going 'uphill' or 'downhill' and consider
whether the 'hill' is steep or flat.



Follower Path Concavity:

What does it mean if the path has a section that is concave
up? What does it mean if the path has a section that is
concave down? What does it mean if the path has sections of
both of these types? What does it mean if the path has
neither concave up nor concave down sections?

A path that is Œconcave upı will be shaped like part of an
upright coffee cup. A path that is Œconcave downı will be
shaped like part of an upside down coffee cup.


Relationships Between Paths:

Do the paths have any symmetry?  Would you expect them to? 
Why or why not?


Distances Between the Leader and a Follower:

Once you have determined the formula for the leader, run a
simulation with the leaderıs trail turned on.  (Note that
there are other suggestions to verify your answer in the
ŒTHINGS TO TRYı section.  Make sure you have tried at least
some of these before you show the trail.  If you show the
trail before you are really sure you are right, you might
end up spoiling all your fun- thereıs no going back once you
have seen the trail of the leader!)

Find a path where a follower seems to get close to the
leader only to have the leader appear to speed up and escape
from the follower.

Why does this happen?  What kinds of generalizations can you
make about the formulas or relationships for which this
happens?

How do the distances between the leaderıs trail stamps
relate to the perceived Œspeedı of the leader?



Leader Stamp Proximity:

Depending on the path that the leader is following, the
leaderıs trail stamps may not be evenly spaced.

What does it mean when the steps are evenly spaced? What
does it mean when the steps are not evenly spaced? What does
it mean when the stamps are closer together? What does it
mean when the stamps are further apart?


THINGS TO TRY ------------- Try moving followers to specific
locations after SETUP has been pressed but before GO has
been pressed.   Make predictions about how different
locations would be helpful.

What can you learn if a follower starts in any of the
following locations? - along the right edge of the screen -
along the left edge of the screen - along the top edge of
the screen - along the bottom edge of the screen - along the
x-axis - along the y-axis - at the origin

What is the most helpful first location for a follower? 
(The location Œon top of the leaderı is, of course, out of
the question!)

What is the most helpful follow-up location for a single
follower or for a group of followers?

Come up with a strategy for placing followers so that you
can determine the path of the leader fairly quickly. 
Describe your strategy.

You may use the command center, the click-and-drag feature,
or the turtle window to move a follower.  The leader is
turtle 0, the followers are all turtles with who > 0.


Try increasing the number of followers. (Even if you think
you have the formula figured out, try using larger NUMFOLLOW
values before you show the leader or the leaderıs trail. )
Why does using a larger NUMFOLLOW value make it easier to
guess the leaderıs formula?


Try increasing the STEPSIZE of the followers. (Even if you
think you have the formula figured out, try using larger
STEPSIZE values before you show the leader or the leaderıs
trail. ) Why does using a larger STEPSIZE value make it
easier to guess the leaderıs formula?


The above discussions all involve trying to guess the path
of the leader.  Alternately, you can know the formula of the
leader and try to guess the paths of the followers.

If you know a leaderıs formula and are trying to guess the
pattern of the followersı paths, make sure to record you
guess before you run the simulation.  Compare your predicted
results with the actual results. - What reasoning led you to
correct predictions? - What assumptions that you made need
to be revised?


EXTENDING THE MODEL ------------------- To add your own
formulas, you need to edit the CONSTANTS declarations.

Add your formula to the current list.  Each addition should
be of the form formula-name [command-list] where
formula-name is the name you will use to reference the
formula and command-list is the set of StarLogo commands you
will use to determine the x and y coordinates of the leader.
- Note that the command list must begin and end with square
brackets. - Within the set of commands you may need to scale
the y-axis to keep the leader from wrapping.  (See for
example, the cubic function.) - You must restrict the domain
of the leader if your formula has values for which it would
be undefined.  (See, for example, the logarithm function.) -
Add formula-name to the MOVE-LEADER procedure and make it
the active formula.

In this simulation, the leader uses only integer x
coordinates.  For which formulas might the results be
different if the leader moved along smaller intervals?


What would happen if the STEPSIZE of the followers was
always set to equal the distance the leader traveled during
its most recent step?


Adjust the procedures so that rectangular graphics windows
do not cause unexpected wrapping.


Do any of these changes impact answers to any of the
questions asked above?


Create leader functions and pick a follower location to get
the following shapes in the followerıs path: - a straight
line with positive slope - a straight line with negative
slope - a horizontal line - a vertical line - a loop - a
circle - a curve with one Œhumpı - a curve with two Œhumpsı
- a curve with three Œhumpsı - a curve with n Œhumpsı



STARLOGO FEATURES ------------------- Switches are used to
show or hide information about the leader.

Coloring of patches is used to draw x and y axes on the
graphics window.

The CONSTANTS declaration is used to make it easier to
change the formula of the leader.

The TOWARDS-NOWRAP command is used to orient the followers.