Merge pull request #4 from concord-consortium/cc-spotlight

Add ability to attach a spotlight to an agent
Prevent multiple calls to start() speeding up model

Previously if start was called a second time, a new
timer would be created that would cause the model to
speed up, and to keep speeding up every time start
was called.

This fixes that by checking to see if the model is
already running when start() is called.
Separate the model run logic from the repainting timer

We now have two timers running, one running the model
at (as close as possible to) 60 steps/second, and
one repainting the screen using requestAnimFrame, to
repaint at the browser's desired frequency.

See more discussion of why it is good practice to
separate the logic and repainting at
http://www.chandlerprall.com/2012/06/requestanimationframe-is-not-your-logics-friend/

This also allows us to speed up or slow down to model
without needing to change requestAnimFrame, which will
be useful in the next commit where we add a function
for this.
Add setter for step frequency.

We can now call Model.setStepFrequency(x) to make
the model call step() at a frequency of x Hz.

This function can be called at any time, allowing
us to have a speed slider in a model that can be
used by a student to speed up or slow down the model.
Draw initial scene before we start run() loop

Because of the timing differences between the run() and the 
animate() loops, @ticks was usually > 1 on the first call 
of draw(). This meant that models that do not automatically 
refresh patches would never draw their initial state.

Now we call draw() once before starting the model, to
paint the initial scene.
index.html page lists sample, test models and doc

Create index.html at root of repo for looking at samples
and doc to make it easier for someone who clones repo to
investigate.

Also makes creation of useful gh-pages branch easier.
add additional contributors section to readme.md
Merge branch 'cc-stepFrequency' into cc
adaptation of Bob Tinkers Global Climate model

Adaptation of a simpler version of Bob Tinkers (Concord Consortium)
Global Climate NetLogo model.
add CC Samples to index.html page
use d3 v2.10 built for Lab instead of D3 v3
adaptation of Bob Tinkers Solar Panel 2.0 model

AgentScript adaptation of Bob Tinkers (Concord Consortium) Solar Panel 2.0
NetLogo model.
use @patches.minX, minY, maxX, and maxY
Climate model: Fix several bugs in model

- Sunlight should start from top
- delete all agents at start so we don't increase
CO2 every time we reset
- Fix add/subtract clouds
Climate model: Allow following of sunlight or CO2

Add buttons for setting a spotlight on a random
sunlight or CO2 agent.
Climate model: hand-pick sunrays for spotlighting

Pick a sun ray that has just come into the model when
following, to better show the lifecycle of an energy
packet. If we can't find a new one, just pick any
random sun ray.

Also fix headingUp calculation (agent.heading can
be > 2pi).
Climate model: Add CO2 graph

Also fix reset function so we reset graphs as well
Add slider to control model speed.

This uses the new Model.setStepFrequrency() function
Climate model: Make graph tick count match model's exactly

Previously, model and graph were just both updating
at 60Hz, which was "close enough" but could occasionally
drift apart.

Now we explicitly check the model's tick#, add data only
if we have a new tick, and fill in duplicate data if we
had several model ticks before the last graph tick.

This allows us to stay in step, even when the model's
speed may change via the slider.
Climate model: Add ability to hide 90% of agents

We go through each agent set in turn and hide 90%,
rounded-down. This ensures that there is always at
least one agent of each breed visible.

If we are hiding, when new sunrays come in they have
a 90% change of being hidden.

New CO2 and Clouds come in visible.

Extra care is taken to ensure only whole clouds are
hidden, treating each cloud as an individual agent.