Skip to content

wsmontes/Ant-Simulator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Ant Colony Simulator

A graphical simulation of an ant colony demonstrating emergent behavior and path-finding algorithms.

Ant Simulator Screenshot

Features

  • Interactive ant colony simulation with customizable parameters
  • A* pathfinding algorithm for efficient navigation
  • Ants with different behaviors based on energy levels
  • Food gathering and transport mechanics
  • Obstacle avoidance and stuck-detection systems
  • Dynamic ant spawning when food packages are delivered

Requirements

  • Python 3.6+
  • Tkinter (usually comes with Python)

Installation

Clone the repository:

git clone https://github.com/yourusername/ant-simulator.git
cd ant-simulator

Usage

Run the simulation:

python ants.py

Controls

  1. First click: Place food source (red circle)
  2. Second click: Place nest (blue circle)
  3. Third click: Reset food and nest locations

Configuration

Use the control panel on the right side to adjust:

  • Number of ants
  • Energy loss rate
  • Ant speed range
  • Number of obstacles
  • Enable/disable ant spawning
  • Toggle lifetime counting

How It Works

The simulation models ant behavior with these key aspects:

  1. Pathfinding: Ants use A* algorithm to find efficient routes between locations
  2. Energy management: Ants lose energy over time and change colors (green→yellow→red)
  3. Food collection: Ants gather food from the source and return it to the nest
  4. Cooperation: Ants can help each other when stuck

License

This project is licensed under the MIT License - see the LICENSE file for details.

About

A graphical simulation of an ant colony demonstrating emergent behavior and path-finding algorithms.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages