Exploring the Emergence of Confusion in Collective behavior through Reinforcement Learning Simulation
This project delves into the fascinating dynamics of animal collective behavior, exploring how confusion and order emerge in multi-agent systems. Using Reinforcement Learning (RL) powered by Ray RLlib, the simulation provides a framework for studying realistic interactions between agents in a 2D environment. With a focus on physics realism and behavioral analysis, the project enables researchers to simulate and study behaviors such as predator-prey dynamics, flocking, or swarming, bridging the gap between biological studies and AI-driven insights.
- Switchable Optimization Algorithms: Effortlessly toggle between various RL optimization algorithms to test and analyze behaviors.
- Realistic Physics: Incorporates particle-based physics to model agent movement and interactions accurately.
- Behavioral Insights: Focus on metrics and visualizations that reveal emergent patterns and their implications in collective dynamics.
Feature | Summary | |
---|---|---|
🧪 | Architecture | Leverages Ray RLlib for multi-agent reinforcement learning simulations.Interactive 2D environment for physics-based agent interactions, implemented in particle_2d_env.py.Highly configurable scenarios via config.py for flexible experimentation. |
🩻 | Visualization | Real-time visualizations using Pygame, making simulations engaging and accessible.Seamless tracking and analysis through Weights & Biases integration.Interactive data exploration with JupyterLab notebooks. |
🧩 | Modularity | Encapsulated behaviors in ParticleAgent class for extensibility.Independent modules for metrics, configuration, and visualization to maintain clean architecture.Easy-to-adapt structure for new scenarios or agent types. |
⚡️ | Performance | Optimized multi-agent simulations with vectorized operations for scalable performance. |
Before getting started with collective_behavior, ensure your runtime environment meets the following requirements:
- Programming Language: Python
- Package Manager: Conda
Install collective_behavior using one of the following methods:
Build from source:
- Clone the collective_behavior repository:
❯ git clone https://github.com/Finebouche/collective_behavior
- Navigate to the project directory:
❯ cd collective_behavior
- Install the project dependencies:
❯ conda env create -f environment.yml
- Register the environment as jupyter kernel:
❯ python -m ipykernel install --user --name collective_behavior
-
Specify you wandb API key in wandb_api_key.txt file
-
Activate the conda environment:
❯ conda activate collective_behavior
- Start JupyterLab:
❯ jupyter lab
This project is protected under the MIT License License.
- List any resources, contributors, inspiration, etc. here.