Netlogo is an animated multi-agent simulation tool. It's like Logo, except you can run thousands of "turtles" (agents) in parallel. There is now a web-based version ( http://www.netlogoweb.org/
), and both it and the old desktop version are open source.
Information about the source code for the web version is down near the bottom of this page: http://www.netlogoweb.org/info