A 3D traffic simulation platform for designing, analysing, and visualising junction networks. Build intersections and roundabouts, connect them with road links, run realistic traffic simulations, and evaluate performance with industry-standard metrics - all in the browser.
# Install dependencies
npm install
# Start the development server
npm run dev
# Production build
npm run build
npm run start
Open http://localhost:3000 in a modern browser.
| Mode | Description |
|---|---|
| View | Free-orbit 3D camera. Watch simulations, follow vehicles in first-person, and inspect statistics. |
| Build | Top-down orthographic view. Place junction objects, drag to position, configure exits, and create links. |
Switch between modes using the Modes dropdown in the header.
Each exit can be individually tuned:
| Option | Range | Description |
|---|---|---|
| Num Lanes In | 1–3 | Inbound lanes entering the junction |
| Lane Count | 1–4 | Outbound lanes leaving the junction |
| Exit Length | 10–60 | Length of the exit arm (world units) |
| Spawn Rate | - | Optional per-exit spawn rate override |
Select a junction object by double-clicking it in Build mode to open the Selection Panel with these options.
Links are bidirectional. Vehicles can traverse them in either direction. They are rendered as Bézier curves with solid and dashed lane markings matching lane configuration.
Press the Confirm button to lock your layout, then press Play to start the simulation.
Vehicles follow the Intelligent Driver Model (IDM) with:
| Button | Action |
|---|---|
| Play | Start simulation |
| Pause | Pause (vehicles freeze in place) |
| Stop | Halt and reset simulation |
| Parameter | Default | Description |
|---|---|---|
| Green Time | 8 s | Duration of green phase per arm |
| Amber Time | 1 s | Warning phase before red |
| Red-Amber Time | 1 s | Transition phase before green |
| All-Red Time | 2 s | Safety gap between phase changes |
| Parameter | Default | Description |
|---|---|---|
| Min Gap | 2 m | Minimum distance on ring for safe entry |
| Min Time Gap | 1.5 s | Time since last vehicle exited ring |
| Safe Entry Distance | 20 m | Look-ahead distance for gap detection |
| Entry Timeout | 1.0 s | Force entry after this queue wait |
| Min Angular Separation | 30° | Vehicles must be spaced at least this far apart on the ring |
Real-time statistics are available in the Stats panel and the popout statistics window.
| Metric | Description |
|---|---|
| Approaching | Vehicles on approach segments |
| Waiting | Vehicles stopped at stop lines |
| Inside | Vehicles currently crossing the junction |
| Exiting | Vehicles on exit segments |
| Entered / Exited | Cumulative flow counters |
| Avg Wait Time | Mean delay per vehicle (seconds) |
| Max Wait Time | Longest individual delay recorded |
| Max Queue Length | Peak queue depth observed |
| Throughput | Vehicles per minute |
| DoS | Degree of Saturation - demand ÷ capacity ratio |
| PRC | Practical Reserve Capacity - how much additional traffic the junction can handle (%) |
| MMQ | Mean Maximum Queue - average of per-arm peak queues |
| LOS | Level of Service - HCM-based A–F grade |
| Grade | Signalised (s) | Roundabout (s) | Interpretation |
|---|---|---|---|
| A | ≤ 10 | ≤ 10 | Free flow |
| B | ≤ 20 | ≤ 15 | Stable flow |
| C | ≤ 35 | ≤ 25 | Stable, acceptable delays |
| D | ≤ 55 | ≤ 35 | Approaching instability |
| E | ≤ 80 | ≤ 50 | Unstable flow |
| F | > 80 | > 50 | Forced / breakdown |
Throughput, Avg Wait, Max Queue, PRC, and MMQ are also computed network-wide across all junctions.
Click the Report button (available after stopping a simulation that has recorded data) to generate a 3-page landscape A4 PDF:
| Page | Content |
|---|---|
| 1 - Junction Diagram | High-resolution rendered diagram of your layout with numbered exits, lane markings, link curves, and a colour-coded legend. |
| 2 - Configuration | Global settings, per-object exit/lane tables, spawning & motion parameters, controller timings, and car class weights. Overflows to additional pages if needed. |
| 3 - Simulation Summary | Overview tiles (spawned, completed, elapsed, avg speed, avg travel time), all-junction aggregate table, and per-junction breakdown with DoS, PRC, MMQ, and LOS pills. Overflows to additional pages for large networks. |
Click the Download button to export your junction layout and simulation configuration as a .jme JSON file.
The save file contains:
Click the Upload button and select a .jme file. The current layout is replaced with the saved configuration. You can immediately confirm and run a simulation.
JME supports real-time peer-to-peer collaboration via WebRTC (PeerJS).
Note: P2P works out of the box over a local network (LAN). For connections across the internet, you will need to configure port forwarding and set up a TURN server and PeerJS signalling server.
Click the ? Tutorial button to start an interactive 21-step guided walkthrough that covers:
Each step highlights the relevant UI element and auto-advances when you complete the required action. Starting the tutorial resets the workspace to a clean state.
| Control | Action |
|---|---|
| Left-click drag | Orbit around scene |
| Right-click drag | Pan |
| Scroll wheel | Zoom in/out |
| Double-click junction | Centre and zoom to that object |
| Click a vehicle (during sim) | Follow in first-person view |
| Backspace | Exit first-person view |
| Control | Action |
|---|---|
| Scroll wheel | Zoom (height adjustment) |
| Left-click drag on object | Move junction |
| Double-click object | Open config panel |
| Click exit arm | Select exit (for linking) |
The default camera position is an isometric view at (20, 35, 20) with a 60° field of view.
Vehicles are rendered as 3D models with 12 body types and 7 colour variants. Each class has distinct physical characteristics:
| Class | Length (m) | Speed | Accel | Default Weight |
|---|---|---|---|---|
| Normal | 1.82 | 1.00× | 1.00× | 25 |
| Hatchback | 1.81 | 1.00× | 1.00× | 20 |
| Coupe | 1.99 | 1.10× | 1.15× | 10 |
| Station | 2.10 | 1.00× | 0.95× | 10 |
| MPV | 2.00 | 0.95× | 0.90× | 8 |
| Pickup | 1.97 | 0.95× | 0.85× | 6 |
| Pickup (Small) | 1.92 | 0.95× | 0.90× | 6 |
| Minibus | 2.16 | 0.90× | 0.75× | 5 |
| Micro | 1.42 | 0.85× | 1.05× | 5 |
| Microcargo | 1.82 | 0.80× | 0.90× | 3 |
| Microtransport | 1.82 | 0.80× | 0.85× | 3 |
| Van | 2.16 | 0.85× | 0.70× | 3 |
Weight determines spawn probability - higher weight = more common. All classes can be individually enabled/disabled and their speed, acceleration, deceleration, and weight overridden in the Sim Config panel.
Colours: Blue, Citrus, Green, Orange, Red, Silver, Violet (randomly assigned at spawn).
All parameters are adjustable in the Sim Config dropdown.
| Parameter | Default | Range | Description |
|---|---|---|---|
| Spawn Rate | 0.5 v/s | 0–5 | Vehicles per second per entry |
| Max Vehicles | 100 | 10–500 | Simultaneous vehicle limit |
| Max Spawn Queue | 25 | - | Per-entry demand cap |
| Max Spawn Attempts/Frame | 20 | - | Spawn loop limit |
| Parameter | Default | Range | Description |
|---|---|---|---|
| Preferred Speed | 10 m/s | 1–30 | Target cruising speed |
| Max Acceleration | 4 m/s² | 0.5–15 | Acceleration cap |
| Max Deceleration | 8 m/s² | 0.5–15 | Emergency braking cap |
| Comfort Deceleration | 4 m/s² | - | Preferred smooth braking |
| Parameter | Default | Range | Description |
|---|---|---|---|
| Min Bumper Gap | 0.5 m | 0–5 | Safety distance between vehicles |
| Time Headway | 0.5 s | 0.1–5 | Speed-proportional following distance |
| Stop Line Offset | 0.01 m | 0–2 | Where vehicles stop relative to lines |
| Parameter | Default | Description |
|---|---|---|
| Sim Seed | "default" |
String seed for deterministic, reproducible simulations |