MCPcopy Index your code
hub / github.com/bones-ai/rust-ants-colony-simulation

github.com/bones-ai/rust-ants-colony-simulation @main

Chat with this repo
repository ↗ · DeepWiki ↗ · + Follow
89 symbols 132 edges 9 files 3 documented · 3%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

Ant Colony Simulation

This is an ant colony simulation, it internally uses kdtree and query caching, it's able to handle about 5k ants on the cpu.

Built with Rust and Bevy game engine

screenshot

Demo

Here's the entire timelapse of the AI learning to drive

youtube

Timelapses with Approach 1

youtube

Usage

  • Clone the repo
git clone git@github.com:bones-ai/rust-ants-colony-simulation.git
cd rust-ants-colony-simulation
  • Run the simulation
cargo run --release

Configurations

  • The project config file is located at src/configs.rs
  • If all ants aren't forming a single trail even after a long time, try increasing ANT_INITIAL_PH_STRENGTH in the configs to a greater value (exmaple: 40.0)

Core symbols most depended-on inside this repo

add_map_to_grid_img
called by 4
src/grid.rs
add_value
called by 3
src/grid.rs
decay_values
called by 3
src/grid.rs
drop_zero_values
called by 3
src/grid.rs
get_values
called by 3
src/grid.rs
window_to_grid
called by 2
src/utils.rs
get_rand_unit_vec2
called by 2
src/utils.rs
toggle_ant_visibility
called by 2
src/gui.rs

Shape

Function 42
Method 26
Class 20
Enum 1

Languages

Rust100%

Modules by API surface

src/ant.rs21 symbols
src/grid.rs20 symbols
src/utils.rs13 symbols
src/pheromone.rs13 symbols
src/pathviz.rs9 symbols
src/gui.rs9 symbols
src/main.rs4 symbols

For agents

$ claude mcp add rust-ants-colony-simulation \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact

Ask about this repo answers extend the page