This project simulates a closed environment where multiple Rock-Paper-Scissors agents with different AI strategies compete, learn, and evolve over time. The simulation visualizes agent movements, interactions, and strategy adaptations using Pygame, while tracking wins, energy levels, and providing detailed statistics and plots.
-
Diverse Agent Types:
- RandomAgent: Chooses moves randomly.
- QLearnAgent: Uses Q-learning to adapt based on opponents' previous moves.
- PredictiveAgent: Analyzes opponents’ move patterns to predict and counter.
- GeneticAgent: Employs genetic algorithms to evolve strategy probabilities over generations.
-
Energy & Survival: Agents have energy levels that increase on wins and decrease on losses or draws, simulating stamina and survival dynamics.
-
Visual Simulation: Real-time visualization of agents moving and interacting in a 2D environment, showing their current moves with icons or colors.
-
Leaderboard: Displays the top agents by wins and energy in a sidebar for easy tracking during simulation.
-
Recording: Optionally record the entire simulation as a GIF.
-
Customizable Settings: Configure agent counts, simulation duration, screen size, FPS, and agent-specific parameters via command-line prompts.
-
Post-Simulation Analysis: Generates plots for wins and move frequencies for deeper insights.
-
Clone the repository:
git clone https://github.com/PunksB1602/Rock_Paper_Scissors.git cd Rock_Paper_Scissors
-
Install dependencies:
pip install -r requirements.txt