This project demonstrates a multi-agent simulation (MAS) where a robot navigates a grid to pick up a key and reach a door located at the edges.
Two types of agents are implemented:
- Reactive Agent: Moves randomly, explores the grid, collects the key, and searches for the door along the edges to open it.
- Cognitive Agent: Plans its path intelligently, first moving towards the key and then directly to the door.
The project is written in C++ and uses object-oriented programming (OOP) principles to model the robot, key, and door, as well as the agents’ behavior.
- POO/: Contains the main entities (
Robot,Porte,Cle) with their methods and states. - POA/: Contains agent implementations.
- main.cpp: Initializes the grid, sets up agents, and runs the simulation with terminal output.
- Configurable grid size (currently 10x6).
- Terminal grid visualization:
R: RobotK: Key (if not collected)D: Closed DoorO: Open Door.: Empty cell
- Reactive Agent: random exploration, key collection, and edge search for the door.
- Cognitive Agent: path planning towards key and then to the door.
- Prevents initial position conflicts (robot, key, and door start in different cells).
- Animation of robot movement with delays for visualization.
- Clone the repository:
git clone <PROJECT_URL>
cd SMA-Robot-Door- Compile the project:
g++ main.cpp POO/*.cpp POA/*.cpp -o simulation -std=c++17- Run the simulation:
./simulation-
Multi-Agent Systems (MAS) : reactive vs cognitive agents
-
Object-Oriented Programming (OOP) in C++
-
Grid exploration and pathfinding
-
Randomized vs planned behavior