Koosha ParidehpourSystems / products / infrastructure
← Back to work

simulation · historical prototype

NetWeave

Traffic simulation where independently optimal routes produced network-wide congestion: local decisions degrading global flow.

GoA*Cellular automataWebSocketsAlgorithms
Traffic-simulation study tracing points of interest through A-star routing, a directed road graph, per-road cellular automata, and a WebSocket browser view.

Engineering lens

Directed-graph routing handles strategic movement while disjoint cellular automata expose lane-level congestion, waves, and gridlock.

Overview

A research-oriented browser simulation of road networks, vehicle flow, and routing decisions. A Go backend streamed state to an HTML/CSS/JavaScript visualization over WebSockets.

Architecture

NetWeave architectureTraffic-simulation study tracing points of interest through A-star routing, a directed road graph, per-road cellular automata, and a WebSocket browser view.01POIs -> A* route cost (road type, speed, turn penalty)02directed road graph03intersections = nodes04roads = edges05per-road 2D cellular automata

NetWeave architecture

  1. POIs -> A* route cost (road type, speed, turn penalty)
  2. directed road graph
  3. intersections = nodes
  4. roads = edges
  5. per-road 2D cellular automata

Connections

  • POIs -> A* route cost (road type, speed, turn penalty) → directed road graph
  • directed road graph → intersections = nodes
  • intersections = nodes → roads = edges
  • roads = edges → per-road 2D cellular automata
Traffic-simulation study tracing points of interest through A-star routing, a directed road graph, per-road cellular automata, and a WebSocket browser view.

Traffic field

Why this simulation architecture

The model separated strategic movement through a directed road graph from local traffic physics. Intersections became graph nodes and road segments became edges, while each road carried a disjoint 2D cellular automaton for vehicles, lanes, and gaps.

Directed graph + cellular automata split

A* routed vehicles between points of interest using road type, speed limit, and turn penalties. The Nagel–Schreckenberg-inspired automata handled acceleration, gap-based slowing, randomized driver variability, lane/merge/intersection behavior, and progression into the next segment.

Routing model

Vehicles spawned at residential POIs, travelled to commercial POIs, then received a new assignment of the opposite type. Congestion-aware weighting and in-route recalculation were documented as future work, not completed functionality.

Emergent traffic behavior

Congestion, stop-and-go waves, and gridlock emerged from local rules on ordinary consumer hardware, making the network-level cost of routing policy visible rather than theoretical.

The system-level routing problem

Within roughly a week, the prototype exposed a mismatch between individually optimal routes and network-wide flow: independently minimizing route cost can concentrate agents on the same attractive segments. The next correction was identified as congestion-aware weighting, dynamic rerouting, and—at the broader system level—occasionally accepting a slower route to reduce aggregate bottleneck pressure.

Experimental authoring workflow

An unsubmitted Stable Diffusion + ControlNet workflow translated hand-drawn road sketches into an OSM-like visual normalization and then into backend network geometry. The proof of concept worked at baseline, but limited data, compute, and iteration time kept accuracy below reliable-ingestion quality.

What was not finished

Congestion-aware A*, dynamic in-route recalculation, and production-grade sketch ingestion were future or experimental directions. This entry does not claim they shipped.

Retrospective / later external comparison

Any comparison to later mapping or routing experiments belongs in a separately sourced retrospective. No claim of prediction, copying, or causal influence is made here.

AI-assistance disclosure

AI-assisted implementation reduced the cost and time required to turn the simulation design into an executable environment. The requirements, architecture, simulation model, algorithm selection, routing design, system interpretation, future direction, and identification of the routing failure mode remained user-owned.

Evidence status

Canonical user brief supplied 2026-08-30

Repository history, submitted Google Doc, MP4 presentation, screenshots, simulation output, and ControlNet experiment artifacts: locate and attach before public publication.

Provenance & Attribution

Evidence source
Supporting project evidence is being assembled
Available in lens
engineering