Giter VIP home page Giter VIP logo

colony-ant-simulator's Introduction

colony-ant-simulator

Simulation of ants colony in python

Explanation of ants' behaviour

  • an ant (called a "scout") travels more or less at random around the colony;
  • if she discovers a food source she returns more or less directly to the nest, leaving a track of pheromones on her way;
  • these pheromones being attractive, ants passing nearby will tend to follow, in a more or less direct way, this track;
  • when they return to the nest, these same ants will strengthen the track;
  • if two tracks are possible to reach the same food source, the shortest one will be covered by more ants at the same time than the long track;
  • the short track will therefore be more and more reinforced, and therefore more and more attractive;
  • the long track, it will eventually disappear, as pheromones are volatile;
  • in the long term, all ants have therefore determined and "chosen" the shortest track.

The objective of this program is to reproduce in Python3 an algorithm that simulates ants' behaviour.

How to use

The simplest way - by default on "theory" mode:

python colony_ant_simulator.py

Use "reality" mode:

python colony_ant_simulator.py -m reality

Get help with option -h:

usage: Colony ant simulator [-h] [-m [{theory,reality}]] [n_ants]

Simulation of ants colony in python.

positional arguments:
  n_ants                Number of ants (recommended: 10-100; default: random number between 10 and 100)

options:
  -h, --help            show this help message and exit
  -m [{theory,reality}]
                        Simulation mode (default: "theory")

Screenshots

Screenshot Screenshot

Requirements

  • Python 3.11
  • coloraide

colony-ant-simulator's People

Contributors

emmanuel-ch avatar riiswa avatar nickumia avatar aadghrr avatar thehappydinoa avatar bauripalash avatar hangrybear avatar dmikonn avatar jistjoalal avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.