donjpierce / traffic Goto Github PK
View Code? Open in Web Editor NEWminimilist traffic simulations using OpenStreetMap and OSMnx
License: GNU General Public License v3.0
minimilist traffic simulations using OpenStreetMap and OSMnx
License: GNU General Public License v3.0
Simulating even a small number of cars (~30) requires too many calculations per time step. Adding traffic lights also increased simulation time. Simulating ~20 second flows takes about an hour.
Fixing this starts with optimizing how cars search for their obstacles. The present, inefficient schema is to determine if there are any obstacles in the car's field of view by looking through a list of all of the cars in the system and comparing their locations to the linspace in the field of view. A similar schema is used for finding red traffic lights. This is monumentally poor design. A more correct framework is for all cars in the system to be sorted by their position. Then each car can look for obstacles by only needing to consider a small subset of the total number of cars. Which subset is determined by the car's position and how the list is sorted.
Other performance issues could potentially be resolved by simply de-cluttering. There is probably excess data being stored that need not be stored, such as in unnecessary usage of indexed loops and indexed boolean statements. Also in the future of this base is to use data frames instead of lists and dictionaries.
Specifically when using sim.init_random_node_start_location()
there is the problem of all cars simultaneously stopping in their tracks at around ~3.400 update iterations. This stoppage issue never occurs with sim.ini_culdesac_start_location()
.
Source of bug unknown.
Update 06/21/20:
Now this only happens with sim.init_culdesac_start_location()
and not with the random node init.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.