This Python simulation employs Particle Swarm Optimization (PSO) to model the exploration of an unknown environment by a swarm of robots. The robots aim to converge on the global best position, represented by a red star on the map, providing a heuristic approach to environmental monitoring. The simulation prompts users to input the swarm size, total area to explore, and the number of iterations, offering flexibility in experimentation.
Environmental monitoring plays a crucial role in understanding and preserving ecosystems. The use of swarms of robots enhances efficiency in exploring vast and uncharted territories, enabling data collection and analysis in a timely manner. PSO provides a decentralized and adaptive solution to guide the swarm toward the most promising areas.
- Clone the repository to your local machine.
- Ensure you have Python installed (version 3.x).
- Install required libraries using:
pip install matplotlib
- Run the simulation by executing the
pso_environmental_monitoring.py
file.
- Swarm Exploration: The swarm of robots dynamically adjusts its positions based on PSO principles to efficiently explore the unknown environment.
- Temperature Representation: Randomly placed temperatures on the map signify different climate conditions, with colors indicating high, normal, and cold temperatures.
- Global Best Position: The red star represents the global best position, guiding the swarm to unexplored territories.
- Dynamic Red Star Movement: After every 20 iterations, the global best position jumps to a new uncharted territory, simulating unpredictable environmental changes.
random
: Used for generating random numbers.math
: Utilized for mathematical operations.matplotlib
: Employed for visualizing the simulation with plots and animations.
The simulation employs Particle Swarm Optimization (PSO), a nature-inspired optimization algorithm.
The velocity and position of each particle are updated using PSO equations, facilitating adaptive movement towards optimal positions.
The Environmental Coverage Efficiency is calculated as the ratio of the total explored area to the total area, expressed as a percentage.
Animated GIFs showcase the simulation run and the efficiency graph, providing a visual representation of the PSO algorithm in action.
PSO Simulation:
Efficiency Graph:
- The Efficiency Graph datas are taken from 50 attempts. Each had a 100 iterations, a total of 100km^2 to explore and a swarm size of 70 to maintain uniformity amongst the attempts.
- The Average Exploration Coverage Efficiency after 50 attempts is 77%
- The simulation assumes a 2D grid representation of the environment.
- Random placement of temperatures may lead to varying results in different runs.
- The convergence threshold may need adjustment based on specific use cases.
- The visualization may not be optimal for very large grid sizes.
- The Calculation of the total explored area is based of the total area and therefore in smaller land masses, it provides in-accurate explored areas as it counts each explored area in smaller fractions and similarly for larger areas.
- Sensory data such as temeprature and terrain shapes tend to be overlayed upon on each other for larger area and spaced out for smaller areas.
- Computational Power nad processing Speeds for larger simulations.
Shyalan Ramesh
Feel free to explore and modify the code to suit your needs!