Skip to content
edvallmPublic

About

Intersection simulator

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

10 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 

Repository files navigation

jraffic

A JavaFX traffic intersection simulation with intelligent traffic light control.

Description

Simulates a four-way intersection with dynamic traffic lights that adapt to congestion. Vehicles can go straight, turn left, or turn right, each indicated by color:

  • 🔵 Blue - Straight
  • 🟡 Yellow - Left turn
  • 🔴 Red - Right turn

Requirements

  • Java 21
  • Maven 3.8+

Build

mvn clean compile

Run

mvn javafx:run

Controls

Key Action
↑ Spawn vehicle moving north
↓ Spawn vehicle moving south
← Spawn vehicle moving west
→ Spawn vehicle moving east
R Spawn vehicle from random direction
ESC Exit simulation

Features

  • Color-coded vehicles by route
  • Adaptive traffic light timing based on congestion
  • Safe distance maintenance between vehicles
  • Collision avoidance at intersection and spawn

About

Intersection simulator

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages