WHAT IS IT?
-----------

This is a simple model of population genetics. There are two
populations, the REDS and the YELLOWS. Each has settable
birth rates. The reds and yellows move around and reproduce
according to their birth rates. When the carrying capacity
of the terrain is exceeded, they die to maintain a
relatively constant population. The model allows you to
explore how differential birth rates affect the ratio of
reds to yellows.

	
HOW TO USE IT
-------------
Each "tick" represents a generation in the time scale of this
model.  

The NUMBER slider sets the carrying capacity of the terrain.
The model is initialized to have a total population of
NUMBER with half the population reds and half yellows.

The RFERTILITY slider sets the average number of children each red
has in a generation. It is set to increment in units of
0.01.

The DIFF-CHILD slider sets the difference in birth rates
between the red and the yellow. For example if RFERTILITY is
set to 1 and DIFF-CHILD is set to 0.02, then the yellow
birthrate would be 1.02. If the DIFF-CHILD slider is set
to -0.01, then the yellow birth rate would be 0.99.

The RCOUNT and YCOUNT monitors display the number of reds
and yellows respectively.

The GO button runs the model. A running plot is also
displayed of the numbers of reds, yellows and total
population (in green).

The RUN-EXPERIMENT button lets you experiment with many
trials at the same settings. That way you can see the
variance of number of generations till extinction.



RUNNING THE MODEL
-----------------

	(1) THINGS TO NOTICE
	--------------------

How does differential birth rates affect the population
dynamics?

Does the population with a higher birth rate always start
off growing faster?

Does the population with a lower birth rate always end up extinct?



	(2) THINGS TO TRY
        -----------------

Try running an experiment with the same settings many times.
Does one population always go extinct? How does the number
of generations till extinction vary?


EXTENDING THE MODEL
-------------------

In this model, once the carrying capacity has been exceeded,
every member of the population has an equal chance of dying.
Try extending the model so that reds and yellows have
different saturation rates. How does the saturation rate
compare with the birthrate in determining the population
dynamics?

In this model, the original population is set to the
carrying capacity (both set to NUMBER). Would population
dynamics be different if these were allowed to vary independently?

STARLOGO FEATURES
-----------------

Note the use of floating point slider values and slider
increments for the RFERTILITY and DIFF-CHILD sliders.

Note the use of a remainder "idiom" to enable the fractional
part of the birth rate.

setfertrem (fert - (int fert))
if (random 100) < (100 * fertrem) [hatch []]

Note also, the use of grim-reaper to keep the total
population relatively stable:

to grim-reaper
settodie (turtle-total - number)
setseed1 random turtle-total
if seed1 < todie [die]
end