Welcome to my repository showcasing various agent-based simulations built using Mesa, a Python library for agent-based modeling. This collection contains diverse examples and templates designed to explore the dynamics of complex systems.
This repository demonstrates the capabilities of agent-based modeling through sample simulations developed using Mesa. Each simulation highlights unique behaviors, interactions, and phenomena observed in complex systems.
- Lotka–Volterra predator–prey model
- Description: a pair of first-order nonlinear differential equations, frequently used to describe the dynamics of biological systems in which two species interact, one as a predator and the other as prey.
- Key Features: Interaction between agents, emergent behaviors.
- For more Details of this Model chekout:Lotka–Volterra predator–prey model
- Clone this repository:
git clone https://github.com/ashwin-r11/ABM-Samples.git cd ABM-Samples
- Set up a virtual environment:
python3 -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate
- Install dependencies:
pip install -r requirements.txt
- Usage:
Run a simulation by navigating to its directory and executing the corresponding Python script:
Some simulations include a graphical interface for visualization, while others output results as logs or data files.
python simulation_name.py
├── README.md # Repository overview
├── LICENSE # License for the repository
├── requirements.txt # Python dependencies
├── .gitignore # Git ignore file
├── docs/ # Documentation and guides
│ ├── index.md # Main documentation file
│ └── simulation_guides.md # Detailed guides for simulations
├── simulations/ # Folder containing all simulation projects
│ ├── __init__.py # Make this a Python package
│ ├── predator_prey/ # Example simulation: Predator-Prey
│ │ ├── main.py # Main script to run the simulation
│ │ ├── model.py # Mesa model definition
│ │ ├── agent.py # Agent definitions
│ │ ├── server.py # Server for visualization
│ │ └── README.md # Explanation of this simulation
│ ├── traffic_flow/ # Example simulation: Traffic Flow
│ │ ├── main.py
│ │ ├── model.py
│ │ ├── agent.py
│ │ ├── server.py
│ │ └── README.md
│ └── ... # Add more simulations here
├── utils/ # Utility scripts shared by simulations
│ ├── visualization.py # Custom visualization components
│ └── data_processing.py # Scripts for data analysis
├── tests/ # Unit tests for your simulations
│ ├── test_predator_prey.py # Tests for Predator-Prey simulation
│ ├── test_traffic_flow.py # Tests for Traffic Flow simulation
│ └── ... # Add more tests here
└── examples/ # Example runs or templates
├── minimal_simulation.py # A minimal example for new users
└── ... # Additional examples