Fun with Turtles

Following on from my last post on running agent based models in MapTube using AgentScript, I’ve now got my “live” tube animation working:

I’ve speeded up the trains by a factor of 10 so you can see them move, but otherwise, it’s just a modification of the coffeescript code I was using before on a standalone web page. This isn’t on the production MapTube website yet, only the development tree as there are still a few problems to iron out. Also, it’s not really live as the data is loaded from an archive file stored on the same site. This highlights one of the problems with loading data dynamically. I could pull a live file straight off of the ANTS server which we use for all our live visualisations. The problem with this is that it’s a cross site request, so I’m going to need to put a JSONP endpoint into the server in addition to regular JSON and XML. The alternative would be to create a proxy on MapTube, but I’m trying to keep the code as generic as possible.

[code language=”js”]
overlay = new AgentOverlay ‘layers’, bounds, map, ()=>
new MyModel "layers", 5, -25, 25, -20, 20, false, false, bounds

Leave a Reply

Your email address will not be published. Required fields are marked *