This project analyzes traffic intersections to evaluate their efficiency. It simulates and measures key performance metrics such as:
- Dead time at traffic lights (periods when no vehicles are crossing)
- Wait times for vehicles at traffic lights
- Overall intersection efficiency
ProyectoSemaforoT.clj
: Main project file containing all traffic analysis logic- Configuration files: Multiple
config{n}.txt
files containing intersection parameters - Data files: Corresponding
data{n}.txt
files with vehicle arrival data
- Analyzes multiple intersections in parallel using Clojure's
pmap
- Calculates average waiting times per intersection
- Identifies intersections with highest/lowest waiting times
- Detects traffic lights with excessive "dead time"
- Generates comprehensive statistics and reports
To run the analysis:
(-mainFinal)
The program will:
- Ask for intersection IDs to analyze
- Process each intersection in parallel
- Display results as they become available
- Allow you to view detailed statistics for specific intersections
- Generate a comprehensive report in
outFinal.txt
tiempo-pasar-individual
: Calculates individual vehicle waiting timetiempo-muerto-crucero
: Calculates dead time at an intersectionpromedio-tiempos
: Calculates average wait times
The analysis provides:
- Number of vehicles passing through each intersection
- Average waiting time across all intersections
- Top 10% of intersections with highest waiting times
- Top 10% of intersections with lowest waiting times
- Traffic lights with highest dead time periods
- Clojure environment
- Configuration and data files properly formatted
See the multiple config files for examples of intersection specifications.