Giter Site home page Giter Site logo

marcusgitaccount / traffic-simulation-cluj-napoca Goto Github PK

View Code? Open in Web Editor NEW
8.0 4.0 1.0 664 KB

Prototyping a traffic simulator for Cluj-Napoca using html5 canvas and a lot of maths and basic AI.

HTML 2.11% JavaScript 97.89%
traffic traffic-simulation nodejs canvas2d js roads math canvas prototype cluj-napoca

traffic-simulation-cluj-napoca's Introduction

Traffic Simulator for Cluj-Napoca

!! Not fully documented repo, future updates will fix this.

About

This projects aims to create a traffic simulator for Cluj-Napoca, Romania. The firsts steps are to choose a zone to represent(in this case Mihai Viteazu Square, main central area of the town as seen in the printscreen below) on the scene(canvas) and create a prototype that will be used in the near future to develop the traffic AI and roads and road logic.

http://prntscr.com/gke16s

Currently developed

  • Roadsystem created with a multigraph and linked lists of 2D vectors. (as seen here: http://prntscr.com/h6ht77)
  • Math utils for linear algebra problems that occured during the project development and more.
  • Mockup api for fetching the points for the roads.
  • Data structures such as Queue, Stack, BinaryHeap, PriorityQueue, LinkedList, Multigraph etc..
  • Models such as Road, Car (they are currently in development)

Currently working on:

  • Updating the Car model and creating the AI for cars. (will be using graphs to easy work with distances between cars)
  • Updating the Road model
  • Enhancing the API.
  • 2D Car representation and physics (acceleration, deceleration, braking, ground friction, steering, maintaining distance from objects near, overtaking other cars in the same lane, changing lanes, etc..)
  • Creating a 2D Vector model with the basic operations needed and putting togheter the existing utilitary functions in the the class Vector2D
  • Changing the road friction based on the weather type(dry road = standard, wet road, snowy, etc..)

TO-DO:

  • create a user dashboard for inserting multiple cars
  • create an interface for users to select the area of the city to simulate traffic on
  • create weather conditions
  • add road obstacles

Installation

  • clone the repo
  • npm i
  • npm start

Notes:

  • . You may have to change the environment variables IP and PORT as they are by default set to 0.0.0.0 and 8080.
  • . No transcripters/loaders such as babel are used to transforms the ES6 code. The project makes use of the ES6 module system and await/async implemented in Chromes 61's V8 engine.
  • . The api is currently just a mockup that sends data collected from Google Maps by hand. :(

Technologies used:

  • NodeJS version > 8.5.0
  • ES6 JS
  • 2D canvas api

License

License link(gplv3)

traffic-simulation-cluj-napoca's People

Contributors

marcusgitaccount avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

ryan2x

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.