# rxr0404/sumo- architecture

> Architecture diagram of the GitHub repository rxr0404/sumo-, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-28). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/rxr0404/sumo-
- Repository: https://github.com/rxr0404/sumo-

## Overview

This repository is a SUMO traffic-simulation coursework project: it reproduces TUD-SUMO ramp scenarios and benchmarks, compares ALINEA control with native TraCI, and evaluates three ramp-signal green-time plans. The principal workflow is to run a configured scenario, interact with SUMO through TUD-SUMO or TraCI, collect traffic measures, and analyze or compare the resulting outputs. README-described capabilities are included, but scenario files and most experiment scripts are not present in the supplied tree; their links therefore use only supported enclosing paths. The sampled controller source supports the wrapper/controller relationship; other wiring follows documented workflows.

Main entry points: [`TUD-SUMO复现/_pylibs/tud_sumo/simulation.py`](https://github.com/rxr0404/sumo-/blob/master/TUD-SUMO%E5%A4%8D%E7%8E%B0/_pylibs/tud_sumo/simulation.py) (Simulation API), [`TUD-SUMO复现/_pylibs/traci`](https://github.com/rxr0404/sumo-/tree/master/TUD-SUMO%E5%A4%8D%E7%8E%B0/_pylibs/traci) (TraCI Client), [`交通调控实验`](https://github.com/rxr0404/sumo-/tree/master/%E4%BA%A4%E9%80%9A%E8%B0%83%E6%8E%A7%E5%AE%9E%E9%AA%8C) (Plan Comparison), [`TUD-SUMO复现/scripts`](https://github.com/rxr0404/sumo-/tree/master/TUD-SUMO%E5%A4%8D%E7%8E%B0/scripts) (Tests A–E)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experiments["Experiments"]
  node_scenario["Ramp Scenario"]
  node_benchmarks["Tests A–E"]
  node_greenplans["Green Plans"]
  node_greenrun["Plan Comparison"]
end

subgraph group_wrapper["TUD-SUMO Wrapper"]
  node_simulation["Simulation API<br/>[simulation.py]"]
  node_controllers["Traffic Controllers<br/>[controllers.py]"]
  node_demand["Traffic Demand<br/>[demand.py]"]
  node_vehicles["Vehicle Access<br/>[_vehicles.py]"]
  node_signals["Signal Access"]
  node_events["Simulation Events<br/>[events.py]"]
end

subgraph group_interface["Simulation Interface"]
  node_traci["TraCI Client"]
  node_native_demo["Native ALINEA<br/>[traci_demo.py]"]
  node_sumo["SUMO Engine"]
end

subgraph group_results["Results"]
  node_metrics["Output Analysis<br/>[analyze_outputs.py]"]
  node_plots["Plots and Data"]
end

node_user(("Researcher"))

node_user -->|"runs tests"| node_benchmarks
node_user -->|"runs comparison"| node_greenrun
node_scenario -->|"configures"| node_simulation
node_benchmarks -->|"runs via"| node_simulation
node_simulation -->|"controls simulation"| node_sumo
node_simulation -->|"manages"| node_controllers
node_controllers -->|"queries and controls"| node_traci
node_demand -->|"supplies demand"| node_simulation
node_vehicles -->|"accesses vehicles"| node_traci
node_signals -->|"accesses signals"| node_traci
node_events -->|"schedules events"| node_simulation
node_native_demo -->|"controls directly"| node_traci
node_traci -->|"exchanges commands"| node_sumo
node_greenplans -->|"defines variants"| node_greenrun
node_greenrun -->|"runs scenarios"| node_sumo
node_benchmarks -->|"collects results"| node_metrics
node_greenrun -->|"summarizes results"| node_metrics
node_metrics -->|"writes analysis"| node_plots
node_sumo -->|"produces outputs"| node_plots

click node_scenario "https://github.com/rxr0404/sumo-/tree/master/TUD-SUMO%E5%A4%8D%E7%8E%B0"
click node_benchmarks "https://github.com/rxr0404/sumo-/tree/master/TUD-SUMO%E5%A4%8D%E7%8E%B0/scripts"
click node_greenplans "https://github.com/rxr0404/sumo-/tree/master/%E4%BA%A4%E9%80%9A%E8%B0%83%E6%8E%A7%E5%AE%9E%E9%AA%8C"
click node_greenrun "https://github.com/rxr0404/sumo-/tree/master/%E4%BA%A4%E9%80%9A%E8%B0%83%E6%8E%A7%E5%AE%9E%E9%AA%8C"
click node_simulation "https://github.com/rxr0404/sumo-/blob/master/TUD-SUMO%E5%A4%8D%E7%8E%B0/_pylibs/tud_sumo/simulation.py"
click node_controllers "https://github.com/rxr0404/sumo-/blob/master/TUD-SUMO%E5%A4%8D%E7%8E%B0/_pylibs/tud_sumo/controllers.py"
click node_demand "https://github.com/rxr0404/sumo-/blob/master/TUD-SUMO%E5%A4%8D%E7%8E%B0/_pylibs/tud_sumo/demand.py"
click node_vehicles "https://github.com/rxr0404/sumo-/blob/master/TUD-SUMO%E5%A4%8D%E7%8E%B0/_pylibs/tud_sumo/_vehicles.py"
click node_signals "https://github.com/rxr0404/sumo-/blob/master/TUD-SUMO%E5%A4%8D%E7%8E%B0/_pylibs/tud_sumo/_traffic_signals.py"
click node_events "https://github.com/rxr0404/sumo-/blob/master/TUD-SUMO%E5%A4%8D%E7%8E%B0/_pylibs/tud_sumo/events.py"
click node_traci "https://github.com/rxr0404/sumo-/tree/master/TUD-SUMO%E5%A4%8D%E7%8E%B0/_pylibs/traci"
click node_native_demo "https://github.com/rxr0404/sumo-/blob/master/TUD-SUMO%E5%A4%8D%E7%8E%B0/scripts/traci_demo.py"
click node_metrics "https://github.com/rxr0404/sumo-/blob/master/TUD-SUMO%E5%A4%8D%E7%8E%B0/scripts/analyze_outputs.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_scenario,node_benchmarks,node_greenplans,node_greenrun toneBlue
class node_simulation,node_controllers,node_demand,node_vehicles,node_signals,node_events toneAmber
class node_traci,node_native_demo,node_sumo toneMint
class node_metrics,node_plots toneRose
class node_user toneIndigo
```

## Components

### Experiments

- [Ramp Scenario](https://github.com/rxr0404/sumo-/tree/master/TUD-SUMO%E5%A4%8D%E7%8E%B0): `TUD-SUMO复现`
- [Tests A–E](https://github.com/rxr0404/sumo-/tree/master/TUD-SUMO%E5%A4%8D%E7%8E%B0/scripts): `TUD-SUMO复现/scripts`
- [Green Plans](https://github.com/rxr0404/sumo-/tree/master/%E4%BA%A4%E9%80%9A%E8%B0%83%E6%8E%A7%E5%AE%9E%E9%AA%8C): `交通调控实验`
- [Plan Comparison](https://github.com/rxr0404/sumo-/tree/master/%E4%BA%A4%E9%80%9A%E8%B0%83%E6%8E%A7%E5%AE%9E%E9%AA%8C): `交通调控实验`

### TUD-SUMO Wrapper

- [Simulation API](https://github.com/rxr0404/sumo-/blob/master/TUD-SUMO%E5%A4%8D%E7%8E%B0/_pylibs/tud_sumo/simulation.py): `TUD-SUMO复现/_pylibs/tud_sumo/simulation.py`
- [Traffic Controllers](https://github.com/rxr0404/sumo-/blob/master/TUD-SUMO%E5%A4%8D%E7%8E%B0/_pylibs/tud_sumo/controllers.py): `TUD-SUMO复现/_pylibs/tud_sumo/controllers.py`
- [Traffic Demand](https://github.com/rxr0404/sumo-/blob/master/TUD-SUMO%E5%A4%8D%E7%8E%B0/_pylibs/tud_sumo/demand.py): `TUD-SUMO复现/_pylibs/tud_sumo/demand.py`
- [Vehicle Access](https://github.com/rxr0404/sumo-/blob/master/TUD-SUMO%E5%A4%8D%E7%8E%B0/_pylibs/tud_sumo/_vehicles.py): `TUD-SUMO复现/_pylibs/tud_sumo/_vehicles.py`
- [Signal Access](https://github.com/rxr0404/sumo-/blob/master/TUD-SUMO%E5%A4%8D%E7%8E%B0/_pylibs/tud_sumo/_traffic_signals.py): `TUD-SUMO复现/_pylibs/tud_sumo/_traffic_signals.py`
- [Simulation Events](https://github.com/rxr0404/sumo-/blob/master/TUD-SUMO%E5%A4%8D%E7%8E%B0/_pylibs/tud_sumo/events.py): `TUD-SUMO复现/_pylibs/tud_sumo/events.py`

### Simulation Interface

- [TraCI Client](https://github.com/rxr0404/sumo-/tree/master/TUD-SUMO%E5%A4%8D%E7%8E%B0/_pylibs/traci): `TUD-SUMO复现/_pylibs/traci`
- [Native ALINEA](https://github.com/rxr0404/sumo-/blob/master/TUD-SUMO%E5%A4%8D%E7%8E%B0/scripts/traci_demo.py): `TUD-SUMO复现/scripts/traci_demo.py`
- **SUMO Engine**

### Results

- [Output Analysis](https://github.com/rxr0404/sumo-/blob/master/TUD-SUMO%E5%A4%8D%E7%8E%B0/scripts/analyze_outputs.py): `TUD-SUMO复现/scripts/analyze_outputs.py`
- **Plots and Data**

### Other components

- **Researcher**

## Connections

- Researcher → Tests A–E: runs tests
- Researcher → Plan Comparison: runs comparison
- Ramp Scenario → Simulation API: configures
- Tests A–E → Simulation API: runs via
- Simulation API → SUMO Engine: controls simulation
- Simulation API → Traffic Controllers: manages
- Traffic Controllers → TraCI Client: queries and controls
- Traffic Demand → Simulation API: supplies demand
- Vehicle Access → TraCI Client: accesses vehicles
- Signal Access → TraCI Client: accesses signals
- Simulation Events → Simulation API: schedules events
- Native ALINEA → TraCI Client: controls directly
- TraCI Client → SUMO Engine: exchanges commands
- Green Plans → Plan Comparison: defines variants
- Plan Comparison → SUMO Engine: runs scenarios
- Tests A–E → Output Analysis: collects results
- Plan Comparison → Output Analysis: summarizes results
- Output Analysis → Plots and Data: writes analysis
- SUMO Engine → Plots and Data: produces outputs
