Ant-inspired Resource Gathering Simulation
© 2013 Sam Pottinger
Released under the GNU GPL v3 license.
Done for CU Boulder CSCI 4900 – Independent Study (Software Engineering, Emergence, and Complex Adaptive Sys.)
Produced under the guidance of Professor Ken Anderson
Background and Motivation
Ant hills, as described by Deborah Gordon, self-organize to create complex adaptive systems optimized to gather materials from various surrounding food sources. Ants, the agents in this complex system, do not have a gloval view of the system but can communicate with each other via pheromones. This simulation takes that idea of ant-like agents coordinating optimized resource gathering networks.
Of course, if simulations can model ant hills, man-made systems can leverage the same optimization behavior to create better networks for gathering resources, physical transportation, etc.
These ant-inspired automata begin by a weighted random walk through adjacent spaces where they are more likely to go to locations with higher pheromone values. When an “ant” finds food, it brings a piece of it to the center of the grid (the nest) and leaves a pheromone trail behind it to encourage other ants to visit the same food source.
The following color coding scheme is used:
- Green squares contain pheromone.
- Grey squares are food sources.
- Red circles indiciate how much food remains at a food source.
- White squares are empty.
- Black squares are occupied by an “ant” automaton.
Development Environment and Standards
The development environment requires Node.js and nodeunit. Most development operations, including changes to the specific behavior of pheromones, can be performed simply by editing constants.js. Inline documentation follows JSDoc standards. However, the use of the “int” and “float” types in documentation is allowed. All lines in .js files should be limited to 80 characters. An 80% code coverage requirement should be enforced for all code outside of view logic and code dealing directly with probabilities where dependency injection requirements are deemed too high.
All automated unit tests can be run via:
$ nodeunit *_test.js
Technologies and Resources Used