Simulates traffic flow using graphs and sprites (GraphStream + a domain model in roadnet / simulation).
Use Java 21+ (java --version). With sdkman you can install and switch JDK versions.
./gradlew runOr run com.barrybecker4.simulations.traffic.TrafficApp from IntelliJ.
The window opens with File → Open traffic map. Example data files live under scala-test/com/barrybecker4/simulations/traffic/data/ (e.g. dumbTrafficMap1.txt).
A second entry point, TrafficDemoApplication, loads a default map and runs the same simulation pipeline (no menu).
Simulation timing and physics are centralized in TrafficSimulationConfig:
deltaTimeSecs— simulation timestep per tick (default0.02).realtimeSpeedFactor— scales wall-clock sleep:sleepMs = (deltaTimeSecs * 1000 * realtimeSpeedFactor).toLong. Default0.1matches the older demo (Thread.sleep(2)ms per tick withdelta=0.02). Use0for no sleep (run as fast as the CPU allows).
./gradlew test