🔧 Key Features
Updated: 26/04/2026
Key
- Have
- In progress / Future / Nice to have
Python RL Inference Service
Status: Fully operational.
Loads trained MAPPO models and serves real-time signal predictions via REST API with stateful GRU hidden state management.
- Loads trained MAPPO agent (GRU-based)
- RESTful action prediction (
POST /predict_action) - Stateful hidden state per junction
- Health monitoring (
GET /health) - Model info endpoint (
GET /model_info) - Comprehensive error handling
- Interactive API documentation (Swagger UI)
- Configurable via environment variables
- Support for 5 junctions with variable action spaces
- Hidden state reset (
POST /reset_hidden) - Request/response caching for identical observations
- Model versioning and switching at runtime
- Metrics collection (request counts, latency)
Python LSTM Predictor Service
Status: Fully operational.
Forecasts traffic density using LSTM neural networks with batch prediction support for RL lookahead planning.
- Loads trained LSTM model (64 units, dropout 0.2)
- Single prediction (
POST /predict) - Batch prediction (
POST /predict-batch) — RL integration - Health monitoring (
GET /health) - Model info endpoint (
GET /model-info) - Performance metrics (
GET /metrics) - Comprehensive error handling
- Interactive API documentation (Swagger UI)
- Configurable via environment variables
- Data normalization (MinMaxScaler)
- Multi-step ahead forecasting (up to 100 sequences)
- Data analysis scripts (edge-analysis.py, trip-analysis.py)
- Docker containerization (multi-stage build)
- Model trained (MAE 0.2084 on normalized data)
- Stationarity enhancements via differencing and scaling
- Comprehensive unit testing (Pytest suite with coloured diagnostice output)
- Achieve MAE < 10% on raw traffic values
- Bidirectional LSTM for enhanced accuracy
- Attention mechanism for temporal weighting
- Real-time model retraining capability
- Weather data integration
- KNN imputation for missing sensor data
Java API Gateway
Status: Fully operational.
Orchestrates requests between RL and LSTM services with JWT authentication and circuit breaker pattern.
- REST API endpoints for traffic control
- Communicates with Python services (RL + LSTM)
- Health checks and monitoring
- Robust error handling
- Service dependency management
- Circuit breaker pattern (Resilience4j)
- JWT authentication (HS256)
- Stateless token-based security
- Load testing capabilities
- API request rate limiting (
RateLimitFilter) - Custom exception management (
RlInferenceException) - OpenAPI/Swagger UI integration (Refined documentation)
- Request/response logging and audit trail
- Metrics export (Micrometer/Prometheus)
- Request validation and sanitization
- Role-based access control (RBAC)
RL + LSTM Integration
Status: Operational.
Services communicate and exchange predictions for coordinated traffic optimization.
- RL service calls LSTM for lookahead planning
- LSTM batch endpoint supports multi-hour forecasts
- Health checks verify both services running
- API Gateway orchestrates requests
- Error handling and fallback mechanisms
- Integration test suite (
test_rl_integration.py) - Feedback loop from traffic state to model retraining
- Distributed tracing between services
- Unified metrics dashboard
SUMO Traffic Simulator Integration
Status: Fully operational as standalone simulator.
- SUMO network configuration
- Vehicle simulation and tracking
- Traffic light control via SUMO
- Simulation metrics and reporting
- Vehicle data collection and logging
- edgeData.xml export for LSTM training
- Real-time traffic state feedback to API Gateway
- Live integration with RL control system
- TraCI (Traffic Control Interface) bidirectional communication
Docker Integration
Status: Fully operational.
Multi-stage builds, Docker Compose orchestration with all 3 services, health checks, and persistent volumes.
- Multi-stage builds for optimization (RL + LSTM)
- Service orchestration with Docker Compose (all 3 services)
- Health checks and automatic restart
- Persistent volumes for trained models
- Network isolation (traffic-network bridge)
- Logging configuration (json-file driver)
- Environment-based configuration
- Kubernetes deployment manifests
- Helm charts for production deployments
- Resource limits and requests configuration
- Container registry (Docker Hub/ECR)
Security & Authentication
Status: JWT authentication implemented and merged to main.
Stateless token-based security with HS256 signing on API Gateway. Python services use internal network communication.
- JWT token generation and validation (Gateway)
- Bearer token authentication for API endpoints
- HS256 signing
- Token expiration and configuration
- Stateless (no server sessions)
- Service-to-service internal communication (no auth required)
- Mutual TLS between microservices via self-signed CA
- TLS 1.3 implementation for inter-service communication
- Rate limiting per authenticated user
- Token refresh mechanism
- Role-based access control (RBAC)
- API key management
- Token revocation/blacklist
- Audit logging for authentication events
Deployment
Status: Cloud deployment on Render operational.
Local Docker Compose development environment fully functional.
- Cloud deployment on Render (RL + LSTM services)
- Local Docker Compose environment (all 3 services)
- Environment-based configuration (local/production)
- Graceful service fallback and degradation
- Model hot-loading without service restart
- Rollback mechanism for failed deployments
- Automated scaling based on load
- Secrets management (environment variables/vaults)
- Performance monitoring and alerting
Monitoring & Observability
Status: Basic health checks and metrics endpoints implemented.
- Health check endpoints (
GET /health) — all 3 services - Model info endpoints (
GET /model_info) — RL + LSTM - Performance metrics endpoint (
GET /metrics) — LSTM - Colored terminal logging (startup, predictions, errors)
- Inference latency tracking
- Colored terminal logging
- Prometheus metrics export
- Grafana dashboards for visualization
- Distributed tracing (Jaeger/Zipkin)
- Centralized logging (ELK Stack/Loki)
- Alert rules and notifications
- SLA/SLO tracking
- Custom business metrics
Documentation
Status: Comprehensive and up-to-date.
MkDocs with Material theme, auto-generated API docs, setup guides, and architecture documentation.
- Root README with architecture and quick start
- RL Service README (endpoints, config, architecture)
- LSTM Service README (endpoints, config, training)
- Integration guide (
docs/INTEGRATION.md) - Features documentation (this file)
- Auto-generated API documentation (Swagger/OpenAPI)
- Setup and troubleshooting guides
- Architecture and design documentation
- Docker Compose configuration documented
- GitHub Pages hosting
- Versioned documentation (multiple versions)
- Search functionality
- Custom domain setup (optional)
GitHub Pages Site
Status: Published.
- MkDocs Material theme
- Auto-generated from main branch docs
- Published at: https://joeaoregan.github.io/TUS-26-ETP-AI-Traffic-Optimisation/
- Search functionality
- Versioned documentation (multiple versions)
- Custom domain setup (optional)