Giter Site home page Giter Site logo

trafficsim's Introduction

Cool looking image

Traffic Simulator for Python 3.7+

This program is a traffic simulator I developed to highlight stressed areas in road networks and potential locations to focus on as a planner. It utilizes A* Search to pathfind multiple AI cars, and cumulatively modifies a road network to find natural locations where vehicles concentrate. It pulls data from OpenStreetMap through OSMNX and plots real-world road networks.

This program comes with a TKinter UI to allow for easier use of the program, without having to do everything through command line. The program still needs to be initialized through command line. It requires OSMNX and all of its dependencies. To install OSMNX go to the OSMNX github page. I recommend using the conda method to install it. To run from there run traffic.py.

Image of using simulator

When saving an image, it will save to the main directory as result.png. Beware, with large maps this image can probably run up on hundreds of megabytes. For a reasonable sized city like Atlanta (represent) it results in a sharp but not unreasonably large image.

If I were to spend more time on this I would probably:

  • Iron out more efficient ways of all pathfinding oriented things. At the moment there are some repeated steps
  • Implement multithreading, for very large road networks it gets slow
  • Find a more accurate sampling method for the starting and end points of the AI "cars", including a more accurate measurement of population density or zoning.
  • If I REALLY wanted to sink time into this I would do some sort of real time simulation, but that's a little much

trafficsim's People

Contributors

wtouchstone avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.