Skip to content

Skparab1/traffic-simulator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Traffic simulator

Project for a hackathon. Built in less than 11 hours, Won 3rd place. Can be used here.

How it works

  • Traffic simulator, which lets you change settings, speed, and light algorithms
  • Simulates the movement of cars on screen
  • Gives results of live wait times and algorithm efficiency

Used Libraries

  • p5.js graphics library

Features

  • completely self-contained - the cars are controlled by their position and the status of their lights. The system controls itself, with algorithms only controlling the light state, and the cars being controlled by the lights.
  • Simulation is randomized - something essential for accurate simulations
  • Runs with 48 cars, pushes cars into arrays one in a while, controlled by settings
  • Lets user change timing, such as light timing and car speed
  • User can change tailgate, the distance that cars tailgate each other

Media