andreasjansson / ants_simulation Goto Github PK
View Code? Open in Web Editor NEWA naïve ant colony simulation. Only useful as a pretty simulation, not sophisticated enough for real ant colony optimisation or anything like that.
A naïve ant colony simulation. Only useful as a pretty simulation, not sophisticated enough for real ant colony optimisation or anything like that.
___________________ /\ \ \_| ants_simulation | | ______________|_ \_/________________/ Requires my_js_lib https://github.com/andreasjansson/my_js_lib A naive Javascript ant colony simulation. Nothing half as complex as actual Ant Colony Optimisation (http://irancic.buksna.net/metah/0262042193.pdf), but it's pretty to look at. The ants form a subsumption architecture by having a number of reactive rules govern their behaviour. The rules are ordered by precedence, and once a rule has applied, no other rules can apply (a bit like [L] in Apache configurations). These are the rules (ordered by precedence, descending): 1. If you carry food and you are at the ant hill: Drop the food and get a new, random, direction of movement. 2. If you carry food and you are next to the ant hill: Drop pheromone and set direction on the ant hill. 3. If you carry food and you are standing on pheromone: Drop pheromone and set direction on the pheromone in front of you (if any). 4. If you carry food: Set direction on the ant hill and drop pheromone. 5. If you have found food: Pick up the food, drop pheromone, and set direction on the ant hill. 6. If you are standing on pheromone: Set direction on the pheromone in front of you (if any). 7. Sense distant pheromone, and if you sense any, set direction on it. Ants don't always follow the rules regarding their movement, sometimes they just walk randomly. Configuration parameters can be found in the Config.js file. Note: In the stylesheet you need to make all child divs of the View node absolutely positioned. Otherwise nothing will work. This simulation can (soon, if not already) be viewed at http://subsumption.jansson.me.uk
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.