Project for the course of Introduction to Intelligent Autonomous Systems (CC3042) of University of Porto made by Francisco Ribeiro and Marisa Azevedo.
To set up this project, you need to install the necessary dependencies and configure the environment. Here are the steps:
-
Install Python 3.8 or later
-
Install the Python-Spade framework. You can do this by running the following command in your terminal:
pip3 install spade
-
Set up an XMPP Server for communication between agents. You can use Prosody, for its installation please follow the instructions in here: Downloading and Installing Prosody – Prosody IM
When installed run the command
systemctl start prosody
orprosodyctl restart
-
Install Pygame. You can do this by running the following command in your terminal:
pip3 install pygame
-
Clone the project repository MultiAgentSystem and navigate into the project directory.
-
Add the users to the XMPP server, if you are using prosody you can run the shell script
adduser.sh
:
./adduser.sh
- Run the
traffic_environment.py
script to start the simulation:
python3 traffic_environment.py
The aim is to design and implement a multi-agent system to efficiently manage traffic across multiple intersections. The agents should communicate with each other and coordinate to manage traffic signals, aiming to minimize waiting times and enhance traffic flow.
Implement intelligent traffic light agents that can adapt to real-time traffic conditions. Use vehicle agents that generate simplified but realistic traffic patterns. Integrate these agents to work in a coordinated way to optimize traffic flow.
Traffic Environment: The environment where the agents live can be based on a grid-like set of roads and intersections. Traffic Light Agents: Each traffic light intersection is controlled by an agent. The agent manages the light timings (Red, Green, Yellow) based on the current traffic conditions and in coordination with other intersection agents. Vehicle Agents: Simulate vehicle agents approaching the intersections and reacting to the traffic lights. They can report waiting times and perhaps even request green lights if waiting time exceeds a certain limit. Central Coordination Agent: This agent gathers data from Traffic Light Agents and perhaps also the Vehicle Agents to manage larger traffic patterns or to intervene in special circumstances (like emergency vehicles coming through). Emergency Vehicle Priority: Implement a feature where emergency vehicles (ambulance, fire brigade, police) have the highest priority and can interact with the Traffic Light Agents to ensure they get a green light. Real-Time Adjustments: Traffic light agents could adapt to traffic conditions, perhaps changing the time the light stays green or red based on the traffic volume. Performance Metrics: Implement metrics to measure the efficiency of traffic management in terms of waiting time, the number of vehicles going through, etc.