Multi-Agent Control of Traffic Signals is a legacy MSE project that explores adaptive traffic-signal control with a small multi-agent system built around SUMO, RabbitMQ, and Python 2.7.
Project status: archived. This repository is preserved for reference and historical documentation. It is not under active development and should not be expected to run unchanged on a modern environment.
Looking for the maintained successor? See
macts-nextfor the leaner, modernized follow-on repository.
Legacy project site: https://k0emt.github.io/macts/
MACTS models two coordinated traffic-light junctions in SUMO:
- JunctionSS (St Saviours)
- JunctionRKLN (Rose Kiln Lane)
The runtime design is message-driven:
- A CommunicationsAgent launches SUMO, advances the simulation, reads detector data through TraCI, and publishes metrics and sensor events.
- Two reactive planning agents (
JSS_Reactive_Agent.pyandJRKL_Reactive_Agent.py) consume junction sensor data and choose the next candidate phase. - A safety agent per junction validates signal progression and minimum timing before issuing traffic-light commands.
- A MetricsAgent aggregates emissions, fuel, noise, halting vehicles, and mean-speed data, then persists a simulation summary to MongoDB.
The repository also includes design documents, project artifacts, UML diagrams, and earlier spike/prototype work from the original graduate project.
| Path | Purpose |
|---|---|
source/macts/ |
Primary legacy implementation: agents, SUMO configs, detector/network files, and RabbitMQ helper scripts |
source/sumo_networks/ |
Additional SUMO network experiments and earlier simulation setups |
source/spikes/ |
Exploratory prototype code and experiments |
docs/ |
Published project artifacts and the legacy project website (docs/index.html) |
portfolio/ |
Editable project documents, presentations, plans, and supporting coursework artifacts |
uml/ |
UML models, diagrams, and sequence/activity illustrations |
references/ |
Papers, reference material, and archived phase deliverables |
Within source/macts/:
CommunicationsAgent.py— orchestrates SUMO, TraCI, RabbitMQ messaging, detector reads, and metric publicationJSS_Reactive_Agent.py— reactive planner for St SavioursJRKL_Reactive_Agent.py— reactive planner for Rose Kiln LaneJSS_SafetyAgent.py/JRKL_SafetyAgent.py— safety validation and traffic-light command publicationTrafficLightSignal.py— signal-state and signal-phase transition rulesMetricsAgent.py— aggregates run metrics and stores them in MongoDBCore.py— shared agent, exchange, metric, and sensor-state primitives
The codebase reflects its original 2011-2012 environment:
- Python 2.7
- SUMO with TraCI
- RabbitMQ (the bundled batch scripts reference RabbitMQ 2.8.1 on Windows)
- MongoDB
- Python packages such as pika and pymongo
- A largely Windows-oriented setup (
*.bathelpers and hard-coded paths)
Important caveats:
- Several scripts use Python 2 syntax and are not Python 3 compatible as written.
- Some paths are hard-coded for the original workstation layout, such as
C:\sumo-0.14.0\bin\andC:\macts\source\macts\. - Parts of the architecture are exploratory or incomplete; for example, collaboration/planning abstractions exist, but the implemented behavior centers on the reactive agents plus safety checks.
This project is best treated as a reconstruction target rather than a turnkey application. If you want to run it, start from source/macts/ and expect to adapt paths, package versions, and broker/database setup.
A likely legacy workflow is:
-
Install a Python 2.7 environment with
pika,pymongo, SUMO, and TraCI bindings. -
Start RabbitMQ and MongoDB.
-
Update the Windows helper scripts if your SUMO or RabbitMQ installation paths differ:
start-command-line.batrabbitmq_init.batrabbitmq_clean.bat
-
Create the RabbitMQ virtual host and users with
rabbitmq_init.bat. -
Declare exchanges with:
python rabbitmq_create_exchanges.py
-
Start the long-running agents in separate terminals:
python MetricsAgent.py python JSS_Reactive_Agent.py python JRKL_Reactive_Agent.py
-
Launch the simulation controller:
python CommunicationsAgent.py low 300
The CommunicationsAgent.py usage pattern is:
python CommunicationsAgent.py [low|medium|full] MAX_NUMBER_SIMULATION_STEPS
Where:
low,medium, andfullselect the SUMO route/configuration variant- the final integer sets the maximum number of simulation iterations
The repository includes unit tests for signal progression logic in:
source/macts/TrafficLightSignalTests.py
Most of the system behavior, however, depends on external legacy services and a matching SUMO environment.
The most useful archival materials are:
docs/index.html— legacy project homepagedocs/nehl_implementation_user_manual.pdf— archived user manualdocs/nehl_implementation_architecture_design.pdf— implementation-phase architecture documentdocs/nehl_implementation_component_design_document.pdf— component design detailsuml/— system context, sequence, and activity diagrams
Use this repository for:
- studying the project structure
- reviewing the original code and design documents
- mining SUMO/RabbitMQ multi-agent experiment ideas
- preserving the original MSE project history
Do not expect:
- ongoing maintenance
- modern dependency management
- current-version compatibility
- production readiness