Skip to content

A simple Traffic Simulation that operates by cars, trucks, pedestrians and traffic lights

License

Notifications You must be signed in to change notification settings

r0masaN/Traffic-Simulation

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Traffic Simulation


Preview gif


TL;DR

This is a simple Traffic Simulation that operates by cars, trucks, pedestrians (3 types of entities) and traffic lights. Each entity has it's own path and follows it. All entities respect each other so they won't just pass through (each other).

In core, the Simulation has a simple Simulation Engine which works with concrete Configuration and Graphics implementation. That means, you can create your own Configuration (implements TrafficSimulationConfiguration) and Graphics implementation (extends TrafficSimulationGraphics). Main laws of simulation are already described in Simulation Engine.


Features

  • Road traffic lights and Pedestrian traffic lights with customizable timers;
  • Different unique velocities in [min, max) for all entities (car, truck, pedestrian);
  • Smooth deceleration and aceleration for all entities;
  • Different customizable paths that unique for each type of entity;
  • All entities have simple AI that controls their moves ("follow the path", "let the pedestrian go", "don't crush into other road user" etc.).

UI

User interface has 3 control buttons:

  • "Restart": restarts the simulation;
  • "Spawn a car": randomly spawns a new car or truck;
  • "Spawn a pedestrian": randomly spawns a new pedestrian.

Screenshots

Default mode Default mode

Show coordinates mode Show coordinates mode

Show max velocities mode Show max velocities mode

Show velocities mode Show velocities mode

Show directions mode Show directions mode

Show paths mode Show paths mode

About

A simple Traffic Simulation that operates by cars, trucks, pedestrians and traffic lights

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages