I had a couple of hours of spare time over the weekend, so I decided to start work on implementing a simple (and well-studied!) ABM in Python for use as a QGIS plugin. I put together a quick series of notes on how to build it, which can be found here. I’ve uploaded the complete scripts to my github page. The project so far implements all of the traditional boids behaviours, as described by Reynolds (1987).
Things it seems to do well:
- All three boids behaviours work
- Behavioural weighting allows fine tuning of the three behaviours for species and context specificity
- Placement of agents at arbitrary initial positions works really well
- Steering away from the study area boundaries looks clumsy but is very effective
Things that need improvement:
- The study area limits are currently a rectangle, this should be updated to interact with a shapefile layer containing shorelines, etc.
- Currently the perception distance is a perfect circle with a fixed radius around the centre of the agent, so is avoidance distance. These might need to be revised to a more complicated system to better represent directional vision, etc.
- All agents always enact their behaviours in the same order each time.
- Presently the model is implemented in two dimensions only, this is for ease of testing and can be fixed in the future.