helga-helga / road-traffic-animation Goto Github PK
View Code? Open in Web Editor NEWSimple simulator of road traffic
Home Page: https://helga-helga.github.io/road-traffic-animation/
Simple simulator of road traffic
Home Page: https://helga-helga.github.io/road-traffic-animation/
Function chooses random image and returns a path to it.
Add class Scene with drawing methods and cars management.
It is necessary to implement loading all images in separate function.
Cars appear not immediately because images load not immediately. Car suddenly appears on a road, but it doesn't move out. At the beginning road is empty and then whole car appears suddenly.
Add input fields for expected value and variance of generating cars. Based on this values to generate cars.
There is cars generator. It uses Math.random()
that generates pseudo-random numbers with continuous uniform distribution x ~ U([0, 1]).
To get distribution on [a, b] we should calculate f(x) = (b - a) * x + a ~ U([a, b]).
If we know expected value and limits for random value, we can calculate a and b.
For example, if we want to generate average 500 cars per minute with dispersion +/- 50 cars,
then a = 450 and b = 550.
Move all functions from utils.js to classes.
Should be available if target lane is free on appropriate area.
Not to generate a car on the lane if previous car haven't moved far enough.
Car should turn and go to another lane.
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.