Skip to content

An multi-agents RL project to prove that complex collective behavior can emerge as a solution to a simple optimization problem

License

Notifications You must be signed in to change notification settings

Finebouche/collective_behavior

Repository files navigation

EMERGENT COLLECTIVE BEHAVIOR

Exploring the Emergence of Confusion in Collective behavior through Reinforcement Learning Simulation

license last-commit repo-top-language


🔗 Table of Contents


📍 Overview

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.

🛠 Key Features

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.

Setup

☑️ Prerequisites

Before getting started with collective_behavior, ensure your runtime environment meets the following requirements:

  • Programming Language: Python
  • Package Manager: Conda

⚙️ Installation

Install collective_behavior using one of the following methods:

Build from source:

  1. Clone the collective_behavior repository:
❯ git clone https://github.com/Finebouche/collective_behavior
  1. Navigate to the project directory:
cd collective_behavior
  1. Install the project dependencies:

Using conda  

❯ conda env create -f environment.yml
  1. Register the environment as jupyter kernel:
❯ python -m ipykernel install --user --name collective_behavior
  1. Specify you wandb API key in wandb_api_key.txt file

  2. Activate the conda environment:

❯ conda activate collective_behavior
  1. Start JupyterLab:
❯ jupyter lab

🎗 License

This project is protected under the MIT License License.


🙌 Acknowledgments

  • List any resources, contributors, inspiration, etc. here.

About

An multi-agents RL project to prove that complex collective behavior can emerge as a solution to a simple optimization problem

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published